Write a statement that increases numPeople by 5. Ex: If numPeople is initially 10, the output is: There are 15 people.
1
Expert's answer
2020-11-05T04:12:23-0500
#include <iostream>
int incFive(int nP) {
return nP += 5;
}
int main()
{
int numPeople;
std::cout << "Please enter the number of people : ";
std::cin >> numPeople;
std::cout << "There are " << incFive(numPeople) << " people.\n";
}
Comments
Leave a comment