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
Why is it now difficult for computer technology to maintain the pace of
KatRina [158]

It now difficult for computer technology as manufacturing cannot keep up with overwhelming transistor demand.

<h3>What was Moore's Law ?</h3>

Moore's Law is the one that talks about the fact that the number of transistors on a microchip is one that often goes up about two years always, even if the cost of computers is reduced.

Based on the above, It now difficult for computer technology as manufacturing cannot keep up with overwhelming transistor demand.

Learn more about computer technology  from

brainly.com/question/24912812

#SPJ1

6 0
2 years ago
Given the following snippet of code, answer the following two questions based on the code: typedef enum {Sun, Mon, Tue, Wed, Thu
ANEK [815]

Answer:

1) The value of x will be 6.

2) The value of y will be 7.

Explanation:

1) The value of x will be 6.  

The enum values are labeled by default from 1. This means that Sun = 1, Mon = 2, Tue = 3 and so on.  

So, x = Mon = 2 and y = Sat = 6  

x increases up to y = 6 in the while loop.  

and then y also increments by 1.  

2)So the value of y = 7.  

You will need actual printf("Sun") or printf("Mon") for printing the actual text for the enum.

7 0
3 years ago
How does the speaker feel about traditional forms of poetry
Salsk061 [2.6K]
A speaker sometimes is not able to capture the intended details since it is affected by homophones.
7 0
3 years ago
Read 2 more answers
List three types of cardinalities for relationships within a relational database.
Afina-wow [57]
This is about identifiers in a record referring to other records.
You can have many to one, one to one, many to many.

E.g., if you have two tables, Authors and Books, then a book record could have a reference to an author record. Since an author can write many books, this would be a many-to-one relationship.


3 0
2 years ago
She wants to sort the list based on the names of the first four gas in ascending order. Which command group dose she navigate to
zubka84 [21]

<u>Best method to sort data:</u>

Best method to sort for data people use excel sheet.  If we have 4 quarter sales data of each select man wise.

1. Open the MS Excel

2. Create blank sheet

3. Create list of salesman and quarter sales in each cells from A1….

4. Select all whole worksheet and paste it the data

5. Once data is copied, custom list is created and select advanced options dialog box, select required field and sorting is achieved.

This is simple’s method for sort the list based on the names of the first four gas in ascending order.

7 0
3 years ago
Read 2 more answers
Other questions:
  • What are multiple worksheets
    7·1 answer
  • The syntax for accessing a class (struct) member using the operator -&gt; is ____.
    15·2 answers
  • What arw two reasons for maintaning your privacy on the internet
    11·2 answers
  • Write a program that will read two floating point numbers (the first read into a variable called first and the second read into
    13·1 answer
  • NEED HELP ASAP
    13·2 answers
  • Select the best answer from the drop-down menu.
    14·2 answers
  • What are the characteristics of computer. Explain any one​
    15·2 answers
  • Where to store <br> ammunition
    5·1 answer
  • WILL MARK BRAINLIEST WORTH ALOT OF POINTS! HELP ME GET THIS DONE
    8·1 answer
  • What year does futurist ray kurzweil believe ai will meet human intelligence?.
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!