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
Alcohol is a gateway drug. true or false?
Llana [10]
Yes because when you are continued or addicted to a certain drug (alcohol) you can get addicted to harder substances
8 0
3 years ago
Read 2 more answers
hich type of denial of service (DoS) attack occurs when a name server receives malicious or misleading data that incorrectly map
shusha [124]

Answer:

DNS poisoning

Explanation:

This type of attack is known as DNS poisoning it is a very common attack that focuses on trying to redirect users of the site that has been attacked towards fake servers. These fake servers belong to the attackers and are used to collect the user's private data, which can then be used by the attackers for a wide range of malicious acts. Aside from stealing user information, this malicious data travels alongside regular user data allowing it to infect various servers easily.

7 0
2 years ago
Jordan has been asked to help his company find a way to allow all the workers to log on to computers securely but without using
lana66690 [7]

Answer:

Webcam

Explanation:

A webcam is mainly used for taking images or videos from the computer. the webcam is a combination of two basic words i.e. web and camera. webcam can be connected to any computer via USB. It can be mounted on the desktop and sometimes it comes inbuilt on the laptops.

A webcam is also used for face recognition function to login to a computer system.

so according to the scenario, the most appropriate answer is a webcam.

6 0
3 years ago
Does anyone know what this logo is??
scoray [572]

Answer:

I have got no idea it looks like an older style

8 0
1 year ago
Read 2 more answers
Which software is used to play, create, and modify audio and video files?
igor_vitrenko [27]
Video Editing software is used to play, create, and modify audio and video files. 
7 0
2 years ago
Read 2 more answers
Other questions:
  • Isabella's manager has asked her to write up a _____ that describes their company's interest in developing a custom software sol
    13·1 answer
  • Show what this program prints. Be exact and complete. Can you explain the behavior of each print statement? 1 2 3 4 5 6 7 public
    12·1 answer
  • A user is experiencing slow performance with their computer. A technician suspects the computer has a virus and runs antivirus s
    12·1 answer
  • What features are offered by most of the email programs with for receiving and sending messages?
    10·1 answer
  • Who developed the idea of a universal network?
    11·1 answer
  • write a script that creates and calls a stored procedure named insert_category. first, code a statement that creates a procedure
    10·1 answer
  • Both UDP and TCP use port numbers to identify the destination entity when delivering a message. Give at least one reason for why
    12·1 answer
  • 24/3*2^2/2*3+(20-10)-40
    9·1 answer
  • Describe comm<br>unication cycle​
    15·2 answers
  • Sharon's company has written a new computer program, and she has been asked to find a way to prevent people from copying the sof
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!