Type definitions (typedefs)
Class definitions
Function definitions
Template definitions
D. Template definitions
main()
{
int k, num = 30;
k = (num > 5 ? (num <= 10 ? 100 : 200) : 500);
printf("
%d", num);
}
200
500
30
Unpredictable
What will be output if you will compile and execute the following c code?
#include
int main(){
char c=125;
c=c+10;
printf("%d",c);
return 0;
}
135
+INF
-121
-135
the question mark should be an equal sign
the first semicolon should be a colon
there are too many variables in the statement
the conditional operator is only used with apstrings
1 byte
4 bytes
8 bytes
16 bytes
True
False
x + y' is a keyword
3 and 20 are constants
3z is a constant
y is a variable and z is a constant
True
False
True
False
True
False
True
False
True
False
the return 0; statement
the first statement after the loop
the statement following the continue statement
the next iteration of the loop
Simple Template Library
Standard Template Library
Static Type Library
Single Type-based Library
True
False
True
False
float
string
int
wchar_t
Keywords have some predefine meanings and these meanings can be changed.
Keywords have some unknown meanings and these meanings cannot be changed.
Keywords have some predefine meanings and these meanings cannot be changed.
None of the above
main()
{
int a[10], i;
for (i = 1; I <= 0; i++)
{
scanf("%d", a[i]);
printf("%d", a[i]);
}
}
10
Logical error
Runtime error
1 to 10 will be displayed
int num[6] = { 2, 4, 12, 5, 45, 5 } ;
int n{} = { 2, 4, 12, 5, 45, 5 } ;
int n{6} = { 2< 4< 12 } ;
int n(6) = { 2, 4, 12, 5, 45, 5 } ;
True
False
True
False
True
False
True
False
0
NULL
1
none of the above
pointers to strings
string to pointer
both
4
2
8
10
True
False
True
False
True
False
Type definitions (typedefs)
Class definitions
Function definitions
Template definitions