.
Home About-us Privacy Policy Contact-us Services

Friday, October 16, 2015

Java - factorial number example - Allprogramexample

ad+1

Factorial number example
class  fact
{
public static void main(String r[] )
{
int i=1,m=1,n;
n=Integer.parseInt(r[0]);
do
{
 m=m*i;
 i++;
}
while (i<=n);
System.out.println("Fact of "+n+"is ="+m);
}
}


0 comments:

Post a Comment

Home About-us Privacy Policy Contact-us Services
Copyright © 2014 All Programs Examples | All Rights Reserved. Blogger Templates Download Blogger Templates