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]
3 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]3 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
Is MS DOS a network operating system?​
chubhunter [2.5K]

Answer:

Operating systems now use networks to make peer-to-peer connections and also connections to servers for access to file systems and print servers. The three most widely used operating systems are MS-DOS, Microsoft Windows and UNIX.

Explanation:

7 0
3 years ago
Jonathan wants to create an online journal. He will use it to share with his friends all the cool places he visits while in Euro
nirvana33 [79]

Answer:

a blog

Explanation:

a forum is for questions, a wiki doesn't make sense in this situation and email wouldn't be used for this either so it should be a blog

7 0
3 years ago
Read 2 more answers
What does NIC stand for?
evablogger [386]
Network Interface Controller
6 0
3 years ago
Ram and hard disks are both forms of data storage. How are they alike? How are they different? In particular, discuss the relati
saw5 [17]

solution:

RAM takes the form of computer chips — integrated circuits — that are either soldered directly onto the main logic board of your computer, or installed in memory modules that go in sockets on your computer’s logic board.

RAM stands for Random Access Memory. The data stored in RAM can be accessed almost instantly regardless of where in memory it is stored, so it’s very fast – milliseconds fast. RAM has a very fast path to the computer’s CPU, or central processing unit, the “brain” of the computer which does most of the work.

Computers need some form of non-volatile storage: A place data can stay even when the computer isn’t being used, so you don’t have to reload and re-enter everything each time you use the computer. That’s the point of having storage, in addition to RAM.

Storage for the vast majority of computers in use today consists of a hard disk drive. Hard drives can provide hundreds or thousands of gigabytes of space that can be used to store applications, documents, data and all the other stuff you need to get your work done

Storage is slower than RAM. Hard disk drives are mechanical devices, so they can’t access information nearly as quickly as memory does. And storage devices in most personal computers use an interface called Serial ATA (SATA), which affects the speed at which data can move between the drive and the CPU.

They affects our computer by these ways

RAM, the most serious bottleneck to improving performance in your computer can be your storage. Even with plenty of RAM installed, computers need to write information and read it from the storage system – the hard drive or the SSD.

Hard drives come in different speeds and sizes. Many operate at 5400 RPM (their central axes turn at 5400 revolutions per minute). You’ll see snappier performance if you can get a 7200 RPM drive, and some specialized operating environments even call for 10,000 RPM drives. Faster drives cost more, are louder and use more power, but they exist as options.


3 0
3 years ago
Pls answer thank you​
Sav [38]

Answer:

That would be your opinion

5 0
2 years ago
Other questions:
  • According to the author, there are five hedging strategies organizations can pursue. One of them is: Select one: a. commit with
    5·1 answer
  • If you were the IT manager for a large manufacturing company,what issues might you have with the use of opensource software? Wha
    10·1 answer
  • 9. Government and corporate officials concerned about security threats do not bring their own cell phones or laptops when travel
    9·1 answer
  • Please debug the below code in Java please.
    15·1 answer
  • Two types of formulas in Excel, what are they? A. Complex and simple, B. General and currency, C. Logical and Boolean, D. Trig a
    15·1 answer
  • To check if your operating system is up to date, click Start then click Control Panel and choose _______________. Select one: a.
    11·1 answer
  • How are comments in a Java program treated by the compiler?
    14·2 answers
  • Explain the concept of “survival of the fittest”
    15·1 answer
  • 1. Select two forms of case designed suitable for ATX power supply and
    13·1 answer
  • Analog computers are general purpose computers : true ? or false ?​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!