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]
2 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]2 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 of the following are ways that
Viefleur [7K]

Answer:

A and b

Explanation:

3 0
2 years ago
A DFA is equivalent in power to an NFA. True False
sattari [20]

Answer: True

Explanation:

  Yes, the given statement is true that a DFA is equivalent to NFA in terms of power. For any type of NFA we can easily build an equal DFA so, the NFA are not much powerful as compared to DFA. Both NFA and DFA are characterized by a similar type of class.

DFA is a special case of NFA and They both defined in the same class of language. Each condition in the DFA get summarized by all the condition that the NFA has itself.

4 0
2 years ago
Find out the names of at least 20 programming languages and their developers.
arlik [135]

Answer:

lala

Explanation:

6 0
2 years ago
Read 2 more answers
What is the abbreviation used for educational sites/?
Dovator [93]
Mainly .com 
educational institutes .edu
8 0
2 years ago
What is force? what are the types of force ? Explain all with suitable examples<br>​
ad-work [718]
Force is a push or pull which is exerted on an objects. Types of Force are

Contact forces
Non contact forces or At a distance forces

Examples of Contact forces are:
Stretching of the spring of a balance
pushing of a pram
kicking of a football
Pushing the door
Hitting the ball etc are some examples of contact forces.

some types of contact forces are given in the list below:

Applied force
Normal force
Frictional force
Tension force
Air resistance force
Spring force
6 0
3 years ago
Other questions:
  • The n modifier after the tilde forces the index variable to expand only to the ______
    15·1 answer
  • What action makes RAM on your computer disappear?
    12·2 answers
  • Which zone of the ocean is deepest ?
    7·2 answers
  • You should structure the<br> first before you search for a relevant picture.
    11·1 answer
  • The company database may be stored on a central database server and managed by a database adminstrator true or false
    12·1 answer
  • The convergence of information technology and operations technology, offering the potential for tremendous improvements in effic
    14·1 answer
  • Which key is used to indent the first line of a paragraph to the right?
    15·2 answers
  • Forms often allow a user to enter an integer. Write a program that takes in a string representing an integer as input, and outpu
    11·2 answers
  • write code to print out all combinations of pairs of numbers 1 through m and 1 through n, separated by a comma
    10·1 answer
  • What are the common camera hazards? When might you encounter these hazards in your life, and what do you plan to
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!