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]
2 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]2 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
2. Which Interface uses
goldenfox [79]

Answer:

<h2>Voice Command</h2>

Explanation:

correct me if I am wrong✔

6 0
2 years ago
Elise has just edited two photos of her cat and three different photos of her dog. She needs to save all five of these photos in
Lera25 [3.4K]
<span>The best answer is A. cat_1, cat_2, dog_1, dog_2, dog_3. Filenames are preferably short and should state the obvious. They should be unique and distinct, with no any duplicates in any given file within the same folder. The other choices either have duplicates, vague or are way too long to be identified quickly. </span>

<span> </span>

7 0
3 years ago
Read 2 more answers
In which area of engineering does material selection play a vital role a design optimization b forensic engineering c mechanical
const2013 [10]
D. Prototyping. This is because a prototype is basically a replica of the original one and in order to find out what all we need to add in our original, material selection plays a vital role in prototypes.
4 0
3 years ago
You are reviewing the output of the show interfaces command for the Gi0/1 interface on a switch. You notice a significant number
harina [27]

Answer:

Collision or electromagnetic interference (EMI)

Explanation:

Some network cables connected to switch or router ports are prone to internal collision (between two frames or packets) and external collision with electromagnetic waves from other sources (EMI).

Electromagnetic waves are also known as radio waves or signals. When they are transmitted, the network cable acts as a receiver, the received signal interferes with the packet in the cable. This is why the cyclic redundancy check (CRC) throws an error.

6 0
2 years ago
What explains the discrepancy between the number of bytes you can
sergejj [24]

Answer:

This is because, the advertisers report the storage space in decimal while the computer reads the storage space in binary.

Explanation:

The advertisers report the storage space in decimal or base 10 because humans count in decimal, whereas the computer reports the storage space in binary or base 2.

Since the computer storage is in bytes and 8 bits equal 1 byte, It is easier to write a storage space of 1 kB as 1000 B but it is actually supposed to be 1024 B(2¹⁰). So, there is a discrepancy of 1024 B - 1000 B = 24 B.

As  we go higher, the discrepancy increases. For example, 1 MB is advertised as 1000 kB = 1000000 B but is actually supposed to be 1024 kB = 1024 × 1024 B = 1048576 B. So, there is a discrepancy of 1048576 B - 1000000 B = 48576 B.

So, the actual number of bytes on the storage device is actually less than that reported due to the different number systems in which they are reported in. This discrepancy is less in memory cards or flash drives though in which the stated value of storage capacity might be the actual storage size.

Note that the base 10 or decimal system was chosen by advertiser since this is what consumers understand.

8 0
2 years ago
Other questions:
  • Angle, oblique, regular, demi, roman, heavy, extra bold, expanded, and compressed are ___________ . Select one: A. type styles B
    10·1 answer
  • Just forgot where she saved a certain file on her computer therefore she searched for all files with jpg file extension which ty
    13·2 answers
  • Question 4 of 20
    5·1 answer
  • Does white space have visual weight? Yes or No
    7·2 answers
  • ☢☢☢does anyone know how to do the TYNKER CANNON assignment ( lesson 2 intro to game design) I'll give BRANLIEST(¬‿¬)❤ dont answe
    11·2 answers
  • Electronic mail is a
    9·1 answer
  • Using complete sentences post a detailed response to the following.
    13·1 answer
  • Delete temp or %temp% files in Windows 10 is safe and, can it help boost up your PC fps?
    5·1 answer
  • How did the ENIAC change computing?<br> how did the eniac change computing
    14·1 answer
  • (Synchronized threads) Write a program that launches 1000 threads. Each thread adds a random integer (ranging from 1 to 3, inclu
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!