NEW
Font size
WorksheetsCSNP-04103 C++ Chapter 7 - 2 - Data Types
Total questions: 10
Worksheet time: 5mins
Which one is the oldest way to define constants?
#define PI 3.14159265359
const float PI = 3.14159265359;
Which one of these instructions does a text replacement during compilation replacing the variable with the value assigned to it?.
const float PI = 3.14159265359;
#define PI 3.14159265359
Floating point numbers are represented in memory as?.
Binary numbers?.
Binary numbers in scientific notation (sign, exponent & mantissa)
What is the longest integer?.
short int
long int
long long int
int
What is the longest floating point type?
long double
float
double
long long long double
In the expression (3 + x / 2) where x is a float data type, the result is a floating point.
False
True
if you declare: int i = 3.89; what is the result of cout << i;
3.0
3
3.89
3.89999
What is the result of the command: cout << char(51);
The number 51 as a character.
The corresponding ASCII code for the number 51.
The number 51 as a floating point
You will get a syntax error.
What the boolean function isalpha(char); does?.
Returns false if char is alphabetic.
Returns true if char is alphabetic.
Returns true if char is numeric.
Returns false is char is alpha-numeric.
Can you read and write values to an enumeration type directly?
Yes
No
