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 } ;
do-while
if-else
goto
for
main()
{
int sub[50];
for(i=0; i<=48;i++)
{
sub[i]=i;
printf("
%d", sub[i]);
}
}
0 to 48 will be displayed
48
49
Compilation Error
const X* const
X* const
X*
X&
main()
{
int a = 0;
for (; i = 0; i++)
printf("%d", a);
}
0
Nothing will be displayed
Infinite loop
None of the above
True
False
.
?
;
none of the above
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
Simple Template Library
Standard Template Library
Static Type Library
Single Type-based Library
the return 0; statement
the first statement after the loop
the statement following the continue statement
the next iteration of the loop
True
False
3
4
5
infinite
A
B
BCPL
C++
while (1)
{i++;}
for( ; ; );
while (true)
{false = 1;}
do
{y = x;}
while (x==0);
True
False
void main()
{
int a = 1, b=2;
int *ip;
ip=&a;
b=*ip;
printf("%d", b);
}
2
1
100
0
True
False
Positive value
Zero
Negative value
None of these
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
a = 5
a += 5
a = b = c
a = b
True
False
True
False
Sequential
Random
Sequential and Random
None of the above
main()
{
void msg()
{
printf("HELLO WORLD");
}
}
HELLO WORLD
Error
None of the above
Null
Only once
At least once
More than Once
Any one of the above
True
False
The smallest individual units of c program
The basic element recognized by the compiler
The largest individual units of program
A & B Both
void main()
{
int a;
int &b = a;
a=100;
printf("b=%d\ta=%d
", b,a);
}
b=100 a=100
b=100 a=0
b=0 a=100
Error
main()
{
xyz: goto abc;
printf("Hello");
abc: printf("World");
goto xyz;
}
Infinite loop
Hello World
World Hello
Compilation error