subject

JAVA PROGRAMMING, WILL GIVE BRAINLIEST, PLS Here are the instructions:
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.

Here is the code:
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;
num--;
prod = prod*num;
}
System. out. println(prod);

}
}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 16:00
Kenny works with an it company. his company is about to launch new software in the market. he has to ensure that this new software is functional and meets all of the quality standards set up at the planning stage. which job profile is kenny likely to have? kenny is likely to have the job profile of a blank .
Answers: 2
question
Computers and Technology, 23.06.2019 18:00
Apunishment or the threat of punishment used to enforce conformity. select the best answer from the choices provided t f
Answers: 1
question
Computers and Technology, 24.06.2019 17:40
The value of sin(x) (in radians) can be approximated by the alternating infinite series create a function (prob3_2) that takes inputs of a scalar angle measure (in radians) and the number of approximation terms, n, and estimates sin(x). do not use the sin function in your solution. you may use the factorial function. though this can be done without a loop (more efficiently), your program must use (at least) one. you may find the mod() function useful in solving the problem.
Answers: 1
question
Computers and Technology, 25.06.2019 05:30
In our new car, we were able to drive 30 miles in a half an hour. from this information, we can determine the car's a. acceleration. b. velocity. c. speed. d. direction.
Answers: 1
You know the right answer?
JAVA PROGRAMMING, WILL GIVE BRAINLIEST, PLS Here are the instructions:
Debug the program so i...
Questions
question
Law, 15.11.2020 05:20
question
Mathematics, 15.11.2020 05:20
question
Mathematics, 15.11.2020 05:20
question
Social Studies, 15.11.2020 05:20
Questions on the website: 13722360