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
andrezito [222]
3 years ago
6

Write a console application that takes an integer input from the user and calculates the factorial of it. Note: factorial of Exa

mple Input: 5 Example Output: 1^ * 2^ * 3^ * 4^ * 5=120
Computers and Technology
1 answer:
Stells [14]3 years ago
4 0

Answer:

The program in Python is as follows:

n = int(input("Integer: "))

product = 1

for i in range(1,n+1):

   product*=i

   if(i!=n):

       print(str(i)+" *",end =" ")

   else:

       print(i,end =" ")

print(" = ",product)

Explanation:

This prompts the user for integer input

n = int(input("Integer: "))

This initializes the product to 1

product = 1

This iterates through n

for i in range(1,n+1):

This multiplies each digit from 1 to n

   product*=i

This generates the output string

<em>    if(i!=n):</em>

<em>        print(str(i)+" *",end =" ")</em>

<em>    else:</em>

<em>        print(i,end =" ")</em>

This prints the calculated product (i.e. factorial)

print(" = ",product)

You might be interested in
Bye guys imma k.ill myself for real this time.
oksano4ka [1.4K]

Answer:

bro no- why?

Explanation:

7 0
3 years ago
Read 2 more answers
Why did it take hundreds
levacccp [35]
Before that there was no way for the image to be recorded and fixed on a surface
5 0
3 years ago
Which security testing activity uses tools that scan for services running on systems? reconnaissance penetration testing network
Fiesta28 [93]

Answer:

Network mapping.

Explanation:

Network mapping seems to be the method of mapping the server visibly and rationally in order to determine the relations at mid of the network as well as the not same nodes.

  • Network mapping is the practice of security checking using software to search against services running on networks.
  • Network performance applications and software contains certain network mapping functions that customize the network
7 0
3 years ago
What best describes the purpose of occupational safety and health Administration
IRISSAK [1]

Under the Occupational Safety and Health Act of 1970, employers are responsible for providing safe and healthful workplaces for their employees. OSHA's role is to help ensure these conditions for America's working men and women by setting and enforcing standards, and providing training, education and assistance.

5 0
3 years ago
Read 2 more answers
Which is said to be ‘computer on a chip’ (a) Micro processors (b) Microcontrollers (c) Both (c) None of the above
fiasKO [112]
I think the answer would be A
5 0
3 years ago
Other questions:
  • What color model should Joe use if he will be using an offset printing press?
    7·1 answer
  • Which of the following has likely attended vocational school?
    10·1 answer
  • You plug a new scanner into a USB port on your Windows system. When you first turn on the scanner, what should you expect to see
    10·1 answer
  • A result of the Gibbons v. Ogden (1824) decision was that states​
    11·1 answer
  • QUESTION: Which is not an example of a video port or cable?
    10·1 answer
  • How we can get NET I'D by IP Address?
    11·1 answer
  • How can a signature be added to an email message? Check all that apply.
    10·2 answers
  • If nobody buys a ticket to a movie, do they still show it?
    5·1 answer
  • Queues can be represented using linear arrays and have the variable REAR that point to the position from where insertions can be
    12·1 answer
  • Rosanna is a middle school teacher. She has installed a spreadsheet program in her computer that tracks the grades and attendanc
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!