write a program to accept a number and print it's factorial
Share
write a program to accept a number and print it's factorial
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Answer:
Democracy is an exciting concept,. The increase in the number of states ascribing to democratic practice has signalled a different life for many who now live free from political oppression or authoritarian rule. It is a complex term for many, especially those in newer democracies. It takes a long time coming to grips with its practical meaning. There is a lot of information about democracy.The duty of educators is to clarify this information at the appropriate level to the learners. Democracy provides a very special challenge because it incorporates aspects of behaviour, skills, knowledge and attitudes as well as questions of politics and power.
import java.util.*;
public class fact
{
public static void main(String args[ ] ) throws exception
{
Scanner sc = new Scanner(System.in);
int i,n, f = 1;
System.out.println("Enter a number");
n=sc.nextInt();
while (i<n)
f = f * i;
i++;
System.out.println("Factorial:"+f);
return 0;
}
}