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
Which marketing strategy is represented by advertisers paying for online display ads?
e-lub [12.9K]

Answer:

The answer is (c) paid media

Explanation:

Because they are paying for the ad to be displayed online. hope this helps!

8 0
3 years ago
What is the difference between websites and web page​
gogolik [260]

Answer:

webpage is a single document on internet under a unique URL. Website is a collection of multiple webpages in which information on related topics or subject is linked together.

4 0
2 years ago
What is the most appropriate data type for each of these items?
Tom [10]
I may be wrong, BUT here is what i think



b) line graph


d) pie graph
7 0
2 years ago
Match the design feature or area of expertise with the benefit or increase in usability it offers. 1. standardized placement of
RSB [31]
<span>The match of the design feature or area of expertise with the benefit or increase in usability it offers would be the following:

 1. standardized placement of elements simplify reading and increase the transparency of the interface
2. plain fonts ensures software fulfills its function in an efficient manner that recognizes and solves likely issues of use
3. cultural fluency takes advantage of preexisting customer expectations regarding layout
4. well-structured program logic enables the designer to make appropriate choices in style and tone for the intended end user</span>
3 0
3 years ago
What does "bbl" mean? my friend uses text slang all the time and i can never understand it unless it's lol.? please help!
Mariana [72]
<span>It means be back later :)</span>
5 0
3 years ago
Other questions:
  • By default, a word document generally displays in ____ view.
    9·1 answer
  • why do programs include keyboard shortcuts for certain actions? do you prefer the mouse or the keyboard/ why?
    7·1 answer
  • Which of the following loop conditions will read all the data in the file assuming that each line in the file contains two integ
    5·1 answer
  • For the preceding simple implementation, this execution order would be nonideal for the input matrix; however, applying a loop i
    6·1 answer
  • What is meant by check digit
    10·1 answer
  • A musical time measurer is a(an)
    10·1 answer
  • Time
    6·1 answer
  • HELP PLS QUICK TRUE OR FALSE QUESTION
    7·2 answers
  • The steps.txt file contains the number of steps a person has taken each day for a year. There are 365 lines in the file, and eac
    12·1 answer
  • Write a paragraph explaining why you think its important to use ethics in computers
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!