Logo 
Search:

Java Article

Submit Article
Comments on Program to find a factorial of a given number
Category: Java (Homework Help)    Author: Easy Tutor

Write a program to find a factorial of a given number.
eg: I/o=3 then O/p=6


Umesh Sharma
Umesh Sharma from United StatesOct 14
hello friends this is umesh m going to define how to create factorial program in java itz very2 simple 4!

Class factorial
{
public static void main(String []args)
{
int res=1;
for(int i=1;i<=4;i++)
{
res =res*i;
System.out.println(res);
}
}
}


Please enter your Comment
  • Comment should be atleast 15 Characters.
  • Please put code inside [Code] your code [/Code].