Write a function in C++ called 'factorial' that will take a positive integer as input and returns its factorial. In math, a factorial is...

# Search Results

Searching for: C++

## Individual Exercises

With the variables given to you, add the numbers together and store it in the variable called sum.

Replace the /* comparison */ comment with the appropriate expression that evaluates whether the variable `first`

is the same size or bigger...

With the code given to you, create a new variable called `quotient`

that stores the `numerator`

divided by the `denominator`

and represented as...

Replace the /* comparison */ comment with the appropriate expression that evaluates whether the variable initial is either a lowercase or...

Complete the code so that it checks if the variable letter is a lowercase vowel (a, e, i, o, or u) and assigns true or false to the...

Complete the code so that the variable polarity is -1 when adding first and second is negative, but polarity is 1 when adding first and...

Replace the `/*date type*/`

comments with the appropriate data types for each variable.

With the variables given to you, calculate the remainder when the variable numerator is divided by the variable denominator and store the...

Replace the `/*data type*/`

comments with the appropriate data types for each variable.

Given an input integer x for a math function defined by y = 3*(x^2) + 5 (three multiplied by the square of x plus five). The variable y...

Given three variables called first, second and third. If third is less than the difference of first and second, then return third....

Given three integer variables called first, second and third, if second is less than first, return false. Otherwise, check if third lies...

Given two string variables called first and second. Write code that concatenates two strings and stores the result in the variable called...

Given three integers named first, second and third, write code that finds the average of the three numbers and that stores the result in...

Given a decimal number called `input`

, calculate the cube of this number. Store the result in the decimal variable called `myCube`

.

Given an integer called `value`

and an array of three integers called `list`

, the boolean `found`

should be `true`

if `value`

is is within `list`

one...

We want to count how many times we walked the family dog in a week. Provided an array of seven integers, representing how many times the...

We want to create a vector of strings, where each element represents a single ingredient so that if we need multiple of that ingredient,...

Given a vector of integers called `numbers`

, count how many negative numbers there are in the vector and return that count.

Write a function called `isOdd`

that receives one integer and returns `true`

if that number is odd (has non-zero remainder when dividing by...

Write a function called `count`

that receives (A) a string and (B) a character, and returns a count of how many times the character is...

Write a function called `countVowels`

that receives a `string`

and returns the count of how many vowels it has, including `a`

,`e`

,`i`

,`o`

, and `u`

and...

Write a function called `makeExcited`

that receives a `char`

and permanently changes the value of it so that it becomes an exclamation mark (...

Write a function called `punctuate`

that receives a `string`

and permanently changes the value of that same string so that if there is a...