CourseNotes
Published on CourseNotes (https://course-notes.org)

Home > Java Code for Finding the Factorial of a Number

Java Code for Finding the Factorial of a Number

Subject: 
Algebra [1]
Rating: 
0
No votes yet
SocialTags: 
Software engineering [2]
Computer programming [3]
Computing [4]
Object-oriented programming languages [5]
D [6]
Factorial [7]
Java [8]
While loop [9]
Do while loop [10]

Java? ?code? ?for? ?finding? ?the? ?factorial? ?of? ?an? ?entered? ?number 1). ? ?/** ? ?? ?*? ?Enter? ?Name ? ?? ?*? ?Enter? ?Class? ?Period ? ?? ?*? ?Teacher? ?Name ? ?? ?*? ?Enter? ?Date ? ?? ?*/ class? ?Factorial{ public? ?static? ?void? ?main(String? ?args[]){ ? ?int? ?LetterI,fact=1;? ?? ?//declare? ?integers ? ?int? ?number=5;? ?//enter? ?number? ?to? ?find? ?the? ?factorial? ?of ? ?? ?for(LetterI=1;LetterI<=number;LetterI++){ fact=fact*LetterI; ? ?} System.out.println("Factorial? ?of? ?"+number+"? ?is:? ?"+fact);? ?? ?? ?? ?//displays? ?the? ?factorial? ?of? ?the number ? ?} }

Source URL:https://course-notes.org/algebra/premium/java_code_for_finding_the_factorial_of_a_number#comment-0

Links
[1] https://course-notes.org/subject/algebra [2] https://course-notes.org/taxonomy/term/1044254 [3] https://course-notes.org/taxonomy/term/1041818 [4] https://course-notes.org/taxonomy/term/1039037 [5] https://course-notes.org/taxonomy/term/1061031 [6] https://course-notes.org/taxonomy/term/1060570 [7] https://course-notes.org/taxonomy/term/1061033 [8] https://course-notes.org/taxonomy/term/1041819 [9] https://course-notes.org/taxonomy/term/1061032 [10] https://course-notes.org/taxonomy/term/1061034