Computers and Technology, 02.11.2020 05:50 ssssss190
Debug the program so it prints the factorial of a positive integer entered by the user. This is calculated by multiplying all the numbers from 1 up to that number together. For example, 5 factorial is 5*4*3*2*1 = 120.
import java. util. Scanner;
public class U4_L1_5_Activity_Two{
public static void main(String[] args){
Scanner scan = new Scanner(System. in);
int num = scan. nextInt();
while(num >= 0){
int prod = 1;
prod = prod*num;
System. out. print(prod);
num--;
}
}
}
Answers: 2
Computers and Technology, 22.06.2019 15:30, gudon986732
When creating a budget, log fixed expenses before income. after income. after savings. at the top.
Answers: 1
Computers and Technology, 22.06.2019 19:30, 710jonathan
The following is an excerpt from a slide presentation. today we will inverse operations solving equations using inverse operations solving inequalities using inverse operations from which part of the presentation does the slide most likely come from? a. introduction b. outline c. body d. conclusion
Answers: 1
Computers and Technology, 23.06.2019 03:00, Julianhooks
State 7 common key's for every keyboard
Answers: 1
Debug the program so it prints the factorial of a positive integer entered by the user. This is calc...
Mathematics, 26.02.2021 22:10
Mathematics, 26.02.2021 22:10
Mathematics, 26.02.2021 22:10
Health, 26.02.2021 22:10
English, 26.02.2021 22:10