The __________ evaluates the expresion on the __________ side of the eual sign and places the corresponding value in te memory.
Which of the following are valid?
x = a + 2 + y
int stamp = (int) 5.5
a + x = 2 + y
int stamp = 14
None of the above.
The code in line 4 is an example of what?
1 int x, y;
2
3 x = 5;
4 y = x;
4 x = 3;
With what data should you use getline() instead of cin?
When and why is it necessary to use cin.ignore()?
Convert the following code snippet to the switch() equivalent.
void useIfElse()
{
string text;
char c;
cin >> c;
if(c == 'e' || c == 'i' || o == 'o')
{
text = "Old MacDonald";
}
else if(c == 'a')
{
text = "Alpha";
}
else if(c == 'u')
{
text = "You";
}
else
{
text = "Invalid Input Received.";
}
}
Convert the following code snippet to the if-else equivalent.
void useSwitch()
{
int i, x;
x = 3;
cin >> i;
switch(i)
{
case 1:
x += 2;
case 2:
case 3:
x -= 9;
break;
case 4:
x = 16;
break;
default:
x = 0;
}
cout << x;
}
Variable and constant names must be uniue; no variable or constant can have the same name in a program. True or False?
Functions must have unique names just like variables and constants. True or False?