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

Compare and contrast the Magna Carta, English Bill of Rights and Petition of Right.
Please Help it’s due at 8pm! complete a full CER using the data provided
Why are the languages, Norweigan Bokmal and Norweigan Nynorsk both dying out?
Evan is going to make a cake for his mother's birthday. It will take 26 minutes to make the cake batter, and the cake needs to bake in the oven for 1 hour and 1
What is depicted on the urn?
What is third party access security?
What is the main theme of feminist theory?
During his basketball career, Karl Malone took 22,975 free throws. He made 42.6% of his free throws. Determine the number of free throws Karl Malone made during
Please answer this question and explain how you got it
What does the frown and wrinkled lip and sneer of cold command on the shattered visage tell about the sculptor?