True
False
float a =123.56;
char ch ='T' * 'A';
char ch ='T' *20;
3 +a = b;
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
#if
#elseif
#undef
#pragma
True
False
True
False
True
False
putchar(65)
putchar('x')
putchar("x")
')
main()
{
unsigned int a = 10;
while (a>=10)
{
int a; a-- ;
}
printf("%i", a);
}
Infinite loop
9
0
None
main()
{
int a = 5, b = 6;
(a == b? printf("%d", a));
}
0
5
Error
None of the above
Storage
Virtual
Friend
Wrapper
True
False
#define sqr(x= x*x)
main()
{
int a = 10, b = 5;
printf("%d, %d", sqr(a+b),sqr(++a));
}
77, 121
225, 121
77< 144
Compilation error
True
False
to go to the next iteration in a loop
come out of a loop
exit and return to the main function
restarts iterations from beginning of loop
True
False
True
False
break
continue
exit
All of the above
a = 5
a += 5
a = b = c
a = b
True
False
True
False
True
False
When new operator cannot allocate memory
When alloc function fails
When type requested for new operation is considered bad< thisexception is thrown
When delete operator cannot delete teh allocated (corrupted) object
int f(int a, int b);
void main()
{
int a = 12, b=154;
printf("%d", f(a, b));
}
int f(int a, int b)
{
if (a<b) return(f(b, a));
if(b==0) return(a);
return (f(b, a % b));
}
2
1
Compilation error
Runtime error
True
False
the return 0; statement
the first statement after the loop
the statement following the continue statement
the next iteration of the loop
std::bad_creat
std::bad_alloc
std::bad_cast
std::bad_typeid
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
void main()
{
char a = 'B';
switch (a)
{
case 'A' : printf("a");
case 'B' : printf("b");
default : printf("c");
}
B
b
bca
bc