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
Rashid [163]
3 years ago
10

Write a while loop that will figure out the factorial of 5 (5!) and print this. It should use two integer variables (i and f) an

d print f at the end:
Computers and Technology
1 answer:
Hoochie [10]3 years ago
7 0

<u>Answer:</u>

<em>void main() </em>

<em>{ </em>

<em>int n, i, fact=1; </em>

<em>printf(""Enter the number\n""); </em>

<em>scanf(""%d"",&n); </em>

<em>i=num </em>

<em>while(i>=1) </em>

<em>{ </em>

<em>fact=fact * i; </em>

<em>i--; </em>

<em>} </em>

<em>printf(""The factorial of given number %d is %d\n"", n, fact); </em>

<em>return 0; </em>

<em>} </em>

<u>Explanation:</u>

This program obtains the number for which the factorial has to be found.

Then run a for loop till the factor of 1 is calculated and inside the for loop the number is multiplied with <em>other numbers in the descending order and finally result is printed. </em>

You might be interested in
What is output by the following program?
zubka84 [21]

The output of the program is 10.

def mult(a, b = 1, c = 1):

    print(a * b * c)

mult(2, 5)

<h3>Code explanation:</h3>

The code is written in python.

  • A function is declared named "multi" and the function has parameter of a, b and c. The default value of b and c are 1.
  • Locally, we print the product of a, b and c.
  • Finally, we call the function with its inputted parameters. Notice we only had 2 argument while calling the function. This simply implies that the default value for c is used. Therefore,  we will have 2 × 5 × 1 = 10

learn more on python here: brainly.com/question/22796383

8 0
2 years ago
A poem for coduction
Nataly_w [17]
I don't know if you want a poem about conduction but if so here ya go

no matter how the heat
different temperatures meet
hot to cold how it's done
4 0
4 years ago
Read 2 more answers
Why would a designer choose to use a static layout? Check all of the boxes that apply.
Dafna1 [17]

Answer:

Explanation:a & c

6 0
3 years ago
​in older systems, often the user interface mainly consisted of _____ screens that allowed a user to send commands to the system
inessss [21]

Typically, in older systems, the GUI would be Text Based

7 0
3 years ago
When considering the best technology for its particular use what should a business consider
saul85 [17]
The very first consideration a businesses should do before spending any money or time on technology is, “why am I doing this?” If there is not a core business benefit to be gained, why do it in the first place? Mainly in business they have very old and outdated computers because they do not need to get better computers or upgrade because they do the job and thats all they need. 
6 0
3 years ago
Read 2 more answers
Other questions:
  • The most popular input device of a computer is a(n) ____.
    6·1 answer
  • Why has unicode become the standard way of converting binary to text??
    8·1 answer
  • The _______ valve protects the air pump from reverse-exhaust pressure.
    11·1 answer
  • Use the code below to answer the following questions. Note that the catch statements in the code are not implemented, but you wi
    8·1 answer
  • To expand the interface within CengageNOWv2, you need to click on the:_______.
    15·1 answer
  • Among the eight unique features of​ e-commerce, which is related to the ability to interact with web technology​ everywhere?
    14·1 answer
  • Does any one here play destiny on xbox one
    12·1 answer
  • Why team goals should be broken into shon-term, medium-term, and long-term goals
    8·2 answers
  • Why was the Internet first developed? Use details and information to explain your answer.
    6·1 answer
  • Click here for a answer
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!