Answer:
the answer is 7
Explanation:
please mark me as brainliest
Public int add2n( int n )
{
int total;
if( n % 2 == 0 )
total = n--;
while( n > 0 )
{
total += n;
n -= 2;
}
return( total );
}
Answer:
void getSpeed(int& speed)
//the function with reference parameter speed and & denote a reference
{ //prompts user to enter a number
cout << "Enter a number in the range of 20 through 70: ";
cin >> speed; //reads the value entered by user
if(speed < 20 || speed> 70)
// if value of speed entered by user is outside the given range
{
speed = 0; // speed is set to 0
} }
Explanation:
In order to check how this function works you can write a main function and print the value of speed as following:
int main()
{ int speed;
getSpeed(speed); //calls getSpeed function
cout<<"speed is "<<speed; } //displays value of speed
Output:
Enter a number in the range of 20 through 70: 50
speed is 50
Output for if condition:
Enter a number in the range of 20 through 70: 80
speed is 0
Answer:
Third Generation Language
Explanation:
it is a high-level programming language such as FORTRAN, COBOL, BASIC, Pascal and C which uses symbols and commands that help programmers with what to do on their systerm , some of these symbols are :(colon), -(hyphen), add (+).