1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
navik [9.2K]
3 years ago
7

In mathematics, the notation n! represents the factorial of the nonnegative integer n. The factorial of n is the product of all

the nonnegative integers from 1 to n. For example: 7! = 1 x 2 x 3 x 4 x 5 x 6 x 7 = 5,040 Write a program that lets the user enter a nonnegative integer and then uses a loop to calculate the factorial of that number. Print the factorial to standard output.
Computers and Technology
1 answer:
hram777 [196]3 years ago
4 0

Answer:

The program to this question can be given as:

Program:

factorial=1 #declare a variable.  

number=int(input("Enter a positive integer:")) #input a number.  

while (number>0): #loop  

   factorial= factorial*number # holding value in factorial variable  

   number=number-1  

print('=',factorial) #print value.

Output:

Enter a positive integer:6  

= 720  

Explanation:

The description of the above python program can be given as:

  • In the above program firstly we define a variable that is "factorial". In this variable, we assign a value that is 1 and it is used to calculate the factorial value.  
  • We define a variable "number". The number variable is used to take input from the user.  
  • Then we define a loop in the loop we calculate the factorial and hold the value in the factorial value in the last we print the value.  

You might be interested in
Which attack intercepts communications between a web browser and the underlying computer?
Vlad [161]

The question has the below multiple choices

A. Man-In-The-Middle (MITM)
B. Man-In-The-Browser (MITB)
C. Replay
D. ARP poisoning

The answer is B

As compared to the Man-In-The-Middle attack, the Man-In-The-Browser attack intercepts communications between parties to manipulate or steal data. This attack seeks to intercept and steal or manipulate communication that exists between the browser and the underlying computer. It begins with a Trojan infecting the underlying computer and installing an extension into the web browser configuration.







6 0
3 years ago
Explain the evolution of computer​
musickatia [10]

Answer:

Explain the evolution of computer​

Evolution of computer technology can be divided into five generations. First generation computer consisted of vacuum tubes and they were used from 1943-1958. ... The fifth generation computers are under development. They are going to be based on principles of artificial intelligence and natural language recognition

Explanation:

8 0
3 years ago
Write an if-else statement that displays 'Speed is normal' if the speed variable is within the range of 24 to 56. If the speed v
kari74 [83]

Answer:

import java.util.Scanner;

public class Speed{

int speed;

public Speed(int speed){

this.speed = speed;

}

public void checkSpeed(){

if(speed >= 24 || speed <= 56){

System.out.println("Speed is normal");

}

else

System.out.println("Speed is abnormal");

}

public static void main(String...args){

Scanner input = new Scanner(System.in);

int userSpeed = 0;

System.out.println("Enter a speed: ");

userSpeed = input.nextInt();

Speed obj1 = new Speed(userSpeed)

obj1.checkSpeed();

}

Explanation:

4 0
4 years ago
On a piece of paper y&lt;=3x then determine which answer matches 5he graph and you drew
fgiga [73]

Answer:

Graph C.

Explanation:

First draw the line as if there is no greater than or less than. Ie., plot y = 3x. Then you can see that answers B and D have a different line so they cannot possibly be right.

Now all we have to figure out is if we have to be above or below y = 3x. The equation says that y has to be smaller than 3x. So for any given x, e.g. x=1, we want to have a smaller y, thus smaller than the 3 that is on the line.

We have to be below the line, so answer C is the right one.

7 0
3 years ago
The second finger on the left hand types _____.<br><br> 3 E D C<br> 1 Q A Z<br> 7 U J M<br> 8 I K ,
hram777 [196]
The first finger on the left (Index) is choice "2" (1,Q,A,Z)

The second finger on the right (Middle) is choice "4" (8,I,K)

The first finger on the right (Index) is "3" (7,U,J,M

Which leaves choice "1" (3,E,D,C)

Hope this helps
7 0
4 years ago
Read 2 more answers
Other questions:
  • Consider the folloeing website URL:http://www.briannasblog.com. What does the "http://" represent?
    11·1 answer
  • Why is operating system pivotal in teaching and learning
    11·1 answer
  • In the Unified Process (UP), related activities are grouped into UP ____. a. Services b. Disciplines c. Cycles d. Practices
    11·1 answer
  • ASAP ε=ε=ᕕ(°□°)ᕗ<br> Sorry if you can't see it but please help me if you can!
    6·1 answer
  • The Windows Operating System: A) is a web-based operating system for the Internet era. B) is a data management application used
    15·1 answer
  • PLEASE HELP ME!!!!!!!
    7·2 answers
  • Advantages and disadvantages of using the command-line interface to manage files and folders
    14·1 answer
  • PLEASE HURRYYY Suppose your employer wants you to purchase a tablet device that you will use to run the company's custom sales s
    15·2 answers
  • What are some examples of duties Information Support and Service workers perform?
    7·2 answers
  • How do solar ovens track the sun as it moves during the day?
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!