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
adell [148]
2 years ago
11

Write a program that lets the user enter a nonnegative integer then uses a loop to calculate the factorial of that number. Displ

ay the factorial.
Computers and Technology
1 answer:
ValentinkaMS [17]2 years ago
3 0

Answer:

Following are the program in c++ language

#include <iostream> // header file

using namespace std;// namespace

int main() // main function

{

    int num; // variable declaration

    long int f=1; // variable declaration

   do

   {

       cout<<"Enter the Positive value:";

       cin>>num;

   } while(num<0); // i check whether   number is non negative or not

   while(num>0) // iterating over the loop

   {

       f=f*num; // calculate the factorial

       num--; // decrement the value of num by 1

   }

   cout<<" factorial is :"<<f; // display the factorial .

   return 0;

}

Output:

Enter the Positive value:7

factorial is :5040

Explanation:

Following are the description of the program .

  • Read the input by user in the "num" variable of "int" type..
  • The do-while will check the enter number is nonnegative number.  
  • While(n>0) loop is calculating the factorial in the  "f" variable .
  • Finally display the factorial .  
You might be interested in
Tim is in charge of the upcoming interschool baketball tournamnent. He wants to arrange all of the teams and their members in al
zalisa [80]
I think the answer is C.
7 0
2 years ago
Personal computer is the rise of what?​
gogolik [260]

Answer:

Overuse injuries of the hand.

Obesity.

Muscle and joint problems.

Eyestrain.

Behavioural problems including aggressive behaviour.

6 0
2 years ago
What is an active cooling solution for a PC?
mina [271]
Reduce the speed of the CPU
6 0
3 years ago
Read 2 more answers
An indication of delayed fuel ignition could be​
Sophie [7]

Answer:

The ignition delay in a diesel engine is defined as the time interval between the start of injection and the start of combustion. This delay period consists of (a) physical delay, wherein atomisation, vaporization and mixing of air fuel occur and (b) of chemical delay attributed to pre-combustion reactions. Physical and chemical delays occur simultaneously.

Hope This Helps!     Have A Nice Day!!

6 0
3 years ago
Which of the following scan only works if operating system’s TCP/IP implementation is based on RFC 793?
Shkiper50 [21]

Answer:NULL Scan

Explanation:RFC 793(Request for comments) is a type of RFC command labeled with the number 793 which can operate with the TCP protocol.They are sort of document form which is from IETF( Internet Engineering Task Force ).

The null scan is scanning protocol used by legal as well as illegal hackers for working in the transfer control protocol architecture. It is used for the identification of the the ports and holes in TCP servers.they can also have the negative impact if used by the illegal hackers.

5 0
2 years ago
Other questions:
  • Which ipv6 static route would serve as a backup route to a dynamic route learned through ospf?
    12·1 answer
  • If you wanted to create a graph that showed how much each value contributed to the whole value, you would use a _____.
    15·2 answers
  • Select all examples of proper keyboarding technique.
    15·2 answers
  • A company gives you a document to review. This document lays out the strengths and weaknesses of a proposed business venture. It
    13·1 answer
  • Many languages distinguish between uppercase and lowercase letters in user-defined names. What are the pros and cons of this des
    8·1 answer
  • When a chart is selected, numerous customization options can be found on which Chart Tools tabs?
    11·2 answers
  • Jenn wants to assign a value to the favorite car variable: favoriteCar = Toyota but gets an error message. What does she need to
    11·1 answer
  • 13) An-Excel-file-is-generally called-a-l-an:
    6·1 answer
  • What do you think that the next version of IR (IR 5.0) will bring if it was discovered in near future? (hint:- advance IR 4.0 fe
    8·1 answer
  • Different the policies and protocols in the industry
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!