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
Explain why testing can only detect the presence of errors, not their absence.
Alchen [17]

Explanation: Testing is a set of activities that aim to detect software anomalies in a way that the errors can be discovered and correctes. The goal of software testing is to observe if the software behavior meet the requirements that they are expected to meet. Testing demonstrates to the developer that the software fullfils its requirements and it is a way to find out if it behaves in a incorrect, undesirable ou different form from the specifications.

6 0
3 years ago
Give a real life of an if statement
bogdanovich [222]

Answer:

If Joe wants to eat an apple then he eats an apple.

Explanation:

The if statement checks if Joe "wants to eat an apple", if it turns out he does not then nothing will happen.

7 0
3 years ago
List the types of infrared we have
Vlad [161]

Answer: infared types like the sun, sun light, heat lamps, and radiators

6 0
3 years ago
Write a function endpoints that takes a list of numbers (eg. [5, 10, 15, 20, 25]) and returns a new list of only the first and l
Ne4ueva [31]

I included a picture of my code below. Best of luck with your assignment.

5 0
3 years ago
Your organization recently deployed a Windows domain controller with Active Directory. All the domain OU users need to run the s
liberstina [14]

<u>Normally windows end user can login 3 ways as follow:</u>

1. End user can Login as local account where user has not connected or even connected to local Area network LAN.

2. Next user can login into cloud accounts nothing but hot mail  accounts

3. Login to windows domain controller where end user should connect to LAN.

Purpose of installation of Windows domain controller with Active Directory is to keep trace and keep log history activities.

Due to windows domain controller with Active Directory end user desktop or laptop has control on software access also.

Every time when end user login on windows domain controller a small modified is executed whenever is required. It is not going effort the workstation performances.

Note: - Domain severs should be POWER on first.

5 0
3 years ago
Other questions:
  • ou work as network administrator for an organization that has a Windows-based network. You want to use multiple security counter
    10·1 answer
  • Create a new conditional format that applies yellow fill (fourth color under Standard Colors) and bold font to values that conta
    14·1 answer
  • Which of the following button should always be included when designing a navigation pictures escape contact FAQ
    5·2 answers
  • Working at a ski resort in the mountains has its own unique security issues. Kenny is the chief information officer for Sundance
    10·1 answer
  • The parameter passing mechanisn used in C is
    5·2 answers
  • What major criteria must a product or process meet in order to be considered emerging technology?
    6·1 answer
  • If cell G7 contains the function ________, it states that if the value in cell C3 is 9, the number 7 will be assigned to cell G7
    6·1 answer
  • ---------------------- use of the Internet to access programs and data on computers that are not owned and managed by the user o
    9·1 answer
  • Functionality testing is primarily used with ____________. firewall protection software development hardening servers server tes
    8·1 answer
  • The ______ process retains copies of data over extended periods of time in order to meet legal and operational requirements.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!