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
True
False
#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
break
continue
exit
All of the above
main()
{
int k, num = 30;
k = (num > 5 ? (num <= 10 ? 100 : 200) : 500);
printf("
%d", num);
}
200
500
30
Unpredictable
An array is a collection of variables that are of the dissimilar data type.
An array is a collection of variables that are of the same data type.
An array is not a collection of variables that are of the same data type.
None of the above.
4
2
8
10
''
" "
'a'
abc'
True
False
?,-
?,:
++<--
none of the above
True
False
True
False
std::bad_creat
std::bad_alloc
std::bad_cast
std::bad_typeid
True
False
True
False
float a =123.56;
char ch ='T' * 'A';
char ch ='T' *20;
3 +a = b;
True
False
for
while
do-while
while & do-while
True
False
True
False
void main()
{
int a = 1, b=2;
int *ip;
ip=&a;
b=*ip;
printf("%d", b);
}
2
1
100
0
main()
{
int a = 5, b = 6;
(a == b? printf("%d", a));
}
0
5
Error
None of the above
void main()
{
float a;
int x = 10, y = 3; a = x / y;
printf("%f", a); }
3.999999
Error
3
3.000000
Simple Template Library
Standard Template Library
Static Type Library
Single Type-based Library
Dennis Ritchie
Ken Thompson
Bill Gates
Peter Norton
True
False
const X* const
X* const
X*
X&
void main()
{
static int a = 1, b, c;
if (a>=2) b=2; c=3;
printf("%d\t%d", b,c);
}
2 3
0 3
0 0
2 0
True
False
Work same as printf()
prints the error message specified by the compiler
prints the garbage value assigned by the compiler
None of the above