Upload files to "OOP/Java/Lab/Week1"
This commit is contained in:
parent
24683dac5a
commit
8542582101
5 changed files with 101 additions and 0 deletions
17
OOP/Java/Lab/Week1/Factorial.java
Normal file
17
OOP/Java/Lab/Week1/Factorial.java
Normal file
|
@ -0,0 +1,17 @@
|
|||
class Factorial
|
||||
{
|
||||
public static void main(String args[])
|
||||
{
|
||||
int a,i,product=1;
|
||||
|
||||
a = Integer.parseInt(args[0]);
|
||||
|
||||
for(i=a;i>0;i--)
|
||||
{
|
||||
product = product * i;
|
||||
}
|
||||
|
||||
System.out.println("Factorial For the Number "+a+" is "+product+".");
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue