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
When virtualization is used and bare-metal solutions are implemented, what is the item that resides between the virtual machines
Yakvenalex [24]

That's the hypervisor.

6 0
3 years ago
Read 2 more answers
An organization needs to maintain data files of its employees in the form of tables. They also need to access and update over th
MrMuchimi
Database software seems to be the most logical.
5 0
3 years ago
Read 2 more answers
What is <br> computer.write its example<br>​
aniked [119]
The definition of a computer is a person or electronic device that makes and stores quick calculations or processes information. An example of a famous human computer is Ada Lovelace. An example of a computer is the MacBook.
3 0
3 years ago
How has the growth of industries that use computer technology changed employment?
KIM [24]
Well Member The Industrial Revolution? Well If You Forgot It Was Like Making Goods Like With Your Hands But Every Since The Factories Came Works Been Kind Of Hard To Find And Such , So If The Growth Of Industries That Use Technology Changes Employment Than We Wouldn't Have Work It Would Have Been The Industrial Revolution All Over Again
8 0
3 years ago
Which of the following best describes the views and arguments about the consequences of
Nitella [24]

Answer:- d)There are diverse views and arguments about the consequences of wearing  Google Glass.

Explanation:-Google glass is a eyeglass that was made with the head-mounted form for the wearable computer display.The glass works on the commands given by the voice.It can operate the internet service,camera, calendar etc.

The Google glass was discontinued because of the consequences of the glass.They were very high priced product and used to capture every picture that the user was looking at and also had issues related with minds .Thus, the correct option is option(d).

3 0
3 years ago
Other questions:
  • Convert 30 to hexadecimal ​
    9·1 answer
  • Pointsfor a failover cluster, what type of network would you use to communicate with an iscsi device?
    15·1 answer
  • Given the following code fragment, what is the data type of roster[9] .name? struct student { string name; double gpa; }; studen
    5·1 answer
  • What is binary number
    11·1 answer
  • Why is the keyboard arranged in the QWERTY style?
    6·2 answers
  • Write a method that will receive 2 numbers as parameters and will return a string containing the pattern based on those two numb
    10·1 answer
  • You want to securely erase data from your hard drive what can you use to do this and what is the process called
    12·2 answers
  • Chapter 15 Problem 6 PREVENTIVE CONTROLS Listed here are five scenarios. For each scenario, discuss the possible damages that ca
    11·1 answer
  • Which screen should be open to customize or personalize a desktop background?
    15·2 answers
  • A group of two or more computer systems linked together via communication devices is called:.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!