Computer Science, asked by Anonymous, 1 year ago

write a program of factorial number.(java program )

Answers

Answered by estherroyin
4

P iS the product.c is the loop control variable.Java program given below

Attachments:

estherroyin: I'm from Kerala
estherroyin: What about your maths?how many chaps left?
estherroyin: Completed 4 - 14 and21-25
Answered by stylishtamilachee
3

Answer:

import java.util.Scanner;

public class Test

{

public static void main ( String args[ ] )

{

int num, i, fact ;

Scanner sc = new Scanner ( System.in) ;

System.out.print(" Enter number : ") ;

num = sc.nextInt( ) ;

fact = 1 ;

for( i=1 ; i < = num ; i++)

{

fact *= i ;

}

System.out.println(" Factorial of" + num + "is:" + fact) ;

}

}

Example output :

Enter number : 6

Factorial of 6 is : 720

Similar questions