write a program to find the factorial of a number using function with no arguement and no return value
Answers
Answered by
0
Answer:
The answer is given in Java environment
Explanation:
public class Factorial
{
void main ()
{
int num = 5;
int fact = 1;
for(int i = 1;i<=fact;i++)
fact = fact * i;
System.out.println("The Factorial is "+fact);
}
}
Similar questions