InterviewSolution
Saved Bookmarks
| 1. |
Java programming to implement the control statement for finding factorial of the given number |
|
Answer» java programming to implement the control STATEMENT for finding factorial of the given number EXPLANATION:CLASS FactorialExample{ public static VOID main(STRING args[]){ int i,fact=1; int number=5;//It is the number to calculate factorial for(i=1;i<=number;i++){ fact=fact*i; } System.out.println("Factorial of "+number+" is: "+fact); } } |
|