Which of the following gets input from the keyboard and store it in a variable named
height?
Give this one a try later!
cin >> height;
Which of the following assign the letter F to the char variable named gender?
,Give this one a try later!
gender = 'F';
What does the following C++ statement do?
double age = 0.0;
Give this one a try later!
a. declare a new variable named age
b. tell the computer that the type of the new variable is double c. set the
initial value of age to 0.0
Answer (all of the above)
int x = 200;
if (x <= 100)
{
x = x * 2;
}
else
{
if (x > 500)
{
x = x * 3;
}
}
cout << x << endl;
What is the output?
Give this one a try later!
, 200
int x = 1;
if (x == 1)
{
x = x + 10;
}
else if (x == 2 || x == 3)
{
x = x + 20;
}
else if (x == 4)
{
x = x + 30;
}
else
{
x = x + 40;
}
cout << x << endl;
What is the output?
Give this one a try later!
11
Which of the following statements about C++ variables name is true?
Give this one a try later!
height?
Give this one a try later!
cin >> height;
Which of the following assign the letter F to the char variable named gender?
,Give this one a try later!
gender = 'F';
What does the following C++ statement do?
double age = 0.0;
Give this one a try later!
a. declare a new variable named age
b. tell the computer that the type of the new variable is double c. set the
initial value of age to 0.0
Answer (all of the above)
int x = 200;
if (x <= 100)
{
x = x * 2;
}
else
{
if (x > 500)
{
x = x * 3;
}
}
cout << x << endl;
What is the output?
Give this one a try later!
, 200
int x = 1;
if (x == 1)
{
x = x + 10;
}
else if (x == 2 || x == 3)
{
x = x + 20;
}
else if (x == 4)
{
x = x + 30;
}
else
{
x = x + 40;
}
cout << x << endl;
What is the output?
Give this one a try later!
11
Which of the following statements about C++ variables name is true?
Give this one a try later!