Java/ J2EE, Oracle Adf Blog
Thursday, 12 February 2015
AnnomousObject
public class FactorialNumber {
int fact (int num)
{
int f=1;
for (int i = 1; i <= num; i++) {
f=f* i;
}
return f;
}
public static void main(String[] args) {
int d= new FactorialNumber().fact(5);
System.out.println(d);
}
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment