Type Casting Flashcards
1
Q
Type casting is a way to convert a variable from one data type to another data type
A
True
2
Q
Which of the following is an example of using the cast operator?
A
(type_name) expression
3
Q
It is considered good programming practice to use the cast operator whenever type conversions are necessary
A
True
4
Q
void integerPromotion() { int i = 17; char c = 'c'; int sum;
sum = i + c; printf("Value of sum : %d\n", sum ); }
Given the C data types and the concept of integer promotion, the above source code would compile and run without errors.
A
True
5
Q
The usual arithmetic conversions are not performed for the assignment operators, nor for the logical operators && and ||
A
True