void main()
{
int a = 1, b=2;
int *ip;
ip=&a;
b=*ip;
printf("%d", b);
}
2
1
100
0
B. 1
24
2
26
None
int x=40;
main(){
int x=20;
printf("
%d",x);
}
40
20
Compilation Error
Garbeg Value
True
False
the return 0; statement
the first statement after the loop
the statement following the continue statement
the next iteration of the loop
the logical operator && cannot be used in a test condition
the while loop is an exit-condition loop
the test condition is always true
the test condition is always false
Dennis Ritchie
Ken Thompson
Bill Gates
Peter Norton
True
False
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
True
False
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
What will be output if you will compile and execute the following c code?
#include
#define x 5+2
int main(){
int i;
i=x*x*x;
printf("%d",i);
return 0;
}
27
343
233
Compiler Error
''
" "
'a'
abc'
main()
{
int a = 5, b = 6;
(a == b? printf("%d", a));
}
0
5
Error
None of the above
void main()
{
int a = 0;
while (a<=50) for(;;) if(++a % 50==0) break;
printf("a = %d", a);
}
a = 100
a = 50
compilation error
runtime error
True
False
True
False
Simple Template Library
Standard Template Library
Static Type Library
Single Type-based Library
#include
int main()
{
float a=5.2;
if(a==5.2)
printf("Equal");
else if(a<5.2)
printf("Less than");
else
printf("Greater than");
return 0;
}
Less than
Equal
Greater than
None of above
main()
{
unsigned int a = 10;
while (a>=10)
{
int a; a-- ;
}
printf("%i", a);
}
Infinite loop
9
0
None
True
False
True
False
the increment should always be ++k
the variable must always be the letter i when using a for loop
there should be a semicolon at the end of the statement
the commas should be semicolons
pointers to strings
string to pointer
both
main()
{
int k, num = 30;
k = (num > 5 ? (num <= 10 ? 100 : 200) : 500);
printf("
%d", num);
}
200
500
30
Unpredictable
True
False
True
False
True
False
std::bad_creat
std::bad_alloc
std::bad_cast
std::bad_typeid
Throw by value and catch by reference.
Throw by reference and catch by reference.
Throw by value and catch by value
Throw the pointer value and provide catch for teh pointer type.
True
False