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
AlladinOne [14]
3 years ago
12

Write a c++ program to calculate the factorial of a number

Computers and Technology
1 answer:
dangina [55]3 years ago
3 0

Answer:

#include <iostream>

int factorial(int n) {

 return (n > 1) ? n*factorial(n-1) : 1;

}

int main() {

 std::cout << factorial(5);

}

Explanation:

Above is an approach using recursion.

It will output 120, which is 5! = 5*4*3*2*1

You might be interested in
Python Question Class 11 attached below
snow_tiger [21]
math = 2-2/3+2/5-2/7+2/9
Print(math)
Simple as that tell me if im wrong its been a while since i didn’t do python
6 0
3 years ago
Which factors have led to the fast growth in IT​
-Dominant- [34]

Answer:

Factors influencing population growth

Economic development. ...

Education. ...

Quality of children. ...

Welfare payments/State pensions. ...

Social and cultural factors. ...

Availability of family planning. ...

Female labour market participation. ...

Death rates – Level of medical provision

7 0
3 years ago
What is the significance of the scientific method?
Gnom [1K]
Hello there! The significance of the scientific method is that it ensures accuracy and it ensures that the experiment was done in the right order.

The scientific method is a widely accepted way of revising and rechecking the work of scientists to see if:

1. The answers match up

2. The experiment was performed correctly

3. The results are accurate

Through the scientific method, the probability is very high that things will not go wrong. The significance of this is that if the scientific method is not applied to an experiment, nobody knows the results. If nobody knows the results, there are many possible unintended consequences that could happen. Hope this helps!
6 0
1 year ago
When you add a zero to the right of a decimal number, it multiplies its value by 10 (For example, "15" becomes "150"). What simi
My name is Ann [436]

Answer:

When you put a 0 on the right side of a binary number it multiplies it by 2

Explanation:

6 0
3 years ago
What’s considered the brain of a computer?
Colt1911 [192]

Answer: The computer brain is a microprocessor called the central processing unit (CPU).

Explanation:

The CPU is a chip containing millions of tiny transistors. It's the CPU's job to perform the calculations necessary to make the computer work -- the transistors in the CPU manipulate the data.

5 0
4 years ago
Read 2 more answers
Other questions:
  • Elsa has collated information for a meeting using Excel. Due to certain developments, some of the data in her worksheet is now r
    6·1 answer
  • 1. You want to schedule a weekly analysis for the Windows servers in your data center. The command should run as a scheduled job
    15·1 answer
  • What type of memory can support quad, triple, and dual channels?
    5·1 answer
  • Alpha Technologies, a newly established company, wants to share information about its work with people all over the world. Which
    9·1 answer
  • How do u make a bored builder
    8·2 answers
  • Create a Python program to solve a simple payroll calculation. Calculate the amount of pay, given hours worked, and hourly rate.
    12·1 answer
  • E) Point out the errors( if any) and correct them:-
    14·1 answer
  • Who is the primary audience for demonstrations of game prototypes made by the developer? A. Another developer B. The distributor
    10·1 answer
  • HELP GEKP HELP HELP HELP HELP Cassandra is shooting a photo series in very low light. What kind of lens opening will
    15·1 answer
  • Not every design choice in your game interface requires having a thought process behind it.
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!