yelp24
yelp24 yelp24
  • 13-12-2020
  • Computers and Technology
contestada

Write an expression that will cause the following code to print "greater than 20" if the value of userAge is greater than 20.

Respuesta :

Cricetus
Cricetus Cricetus
  • 21-09-2021

The code of the given query is presented below.

Program explanation:

  • Declaration of header file.
  • Declaration of main method.
  • Declaration of integer type variable.
  • Enter a value.
  • Use of if statement.

Program code:

#include <iostream>    //header file

using namespace std;

int main()   //main method

{

int userAge;

cin>>userAge;

if(userAge > 20)

{

cout<<"greater than 20" << endl;

}

else

{

cout<< "20 or less" <<endl;

}

return 0;

}

Output:

Find the attachment below.

Learn more about program code here:

https://brainly.com/question/17782638

Ver imagen Cricetus
Answer Link

Otras preguntas

someone help!!! the image is below with question!
If a gas at 25.0 °C occupies 3.60 liters at a pressure of 1.00 atm, what will be its volume at a pressure of 2.50 atm?
What effect did the migration period have on Western Europe?
David is preparing a report to show
Need help ASAP. WILL MARK BRAINLIEST.
Jordon and Heidi share income equally. For the current year, the partnership net income is $40,000. Jordon made withdrawals of $14,000, and Heidi made withdrawa
Begin authentic and genuine during interactions with others is most demonstrative of which of the following
The following is the cash collection model the company uses for its cash budget: 50% month of sale 40% month after sale 10% 2 months after sale The compositio
6-3-4 How many solutions does this equation have?
What is the y-intercept of the line given by the equation below? y = 8x + 7