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
How does coding work on computers?
sleet_krkn [62]
Coding works through programming/programs. Programs have different coding languages, and text files. The code within the file is known as the "source CODE" this code is used in different ways, causing for the possibility of separate binary files that computers can directly run. Hope I helped.

5 0
3 years ago
What is the force that resists the motion of an object through a fluid?
STALIN [3.7K]

Answer:

Friction (drag)

Explanation:

The force resisting motion through a fluid is a type of friction, that is called drag.

4 0
2 years ago
Write a program to accept radius and find area of circle
Ilya [14]

Answer:

Change it however you'd like

Explanation:

from math import pi

def findArea(rad):

   return (rad**2) * pi

#test

print(f"Area of the circle: {findArea(5)}")

8 0
2 years ago
Read 2 more answers
Create a Python program to solve a simple pay calculation.
Travka [436]

Answer:

def weeklyPaid(hours_worked, wage):  

   if hours_worked > 40:  

       return 40 * wage + (hours_worked - 40) * wage * 1.5

   else:  

       return hours_worked * wage  

 

 

hours_worked = 50

wage = 100

 

pay = weeklyPaid(hours_worked, wage)  

 

print(f"Total gross pay: Rs.{pay:.2f} ")

Explanation:

provides gross pay

6 0
2 years ago
The local area network software called a ____ server provides workstations with the authorization to access a particular printer
Oksana_A [137]

Answer:

I think Its a Wi-Fi

                         

6 0
2 years ago
Other questions:
  • How i can connect to internet automatically when i switch on my computer?
    8·1 answer
  • Which button could Pamela press in the Microsoft Word spell checker to make the word “colour” instantly change to “color” whenev
    11·1 answer
  • You use the Paste Options button labeled ____ if you want the pasted chart not to be linked to the source document and you want
    13·2 answers
  • 7. When using find command in word we can search?
    7·1 answer
  • What is the function of the command prompt?
    8·1 answer
  • 1.Input device which transfers information and images from physical documents to computer files.
    14·1 answer
  • SHOW ALL YOUR WORK. REMEMBER THAT PROGRAM SEGMENTS ARE TO BE WRITTEN IN JAVA. Assume that the classes listed in the Java Quick R
    9·1 answer
  • Select the examples of common Arts, A/V Technology, and Communication employers. Check all that apply.
    10·2 answers
  • Please help it’s timed
    5·1 answer
  • You have been asked to analyze the Excel data provided by your IT department. You would like to have the ability to sort and fil
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!