Time remaining
:
:
Test Status
CRANDOMTEST
Ques 1 :
What is the output of the following program?
void main(){
int a;
a=10;
while(a++<=15)
printf("%d",a);
printf("%d",a+10);
}
(A) 10 11 12 13 14 15 16
(B) 11 12 13 14 15 16 27
(C) 10 11 12 13 14 15 25
(D) 11 11 12 13 14 15 25
Ques 2 :
How many variables scopes are there in "C" language?
(A) 2
(B) 3
(C) 4
(D) 5
Ques 3 :
What is the output of following program?
void main(){
int a=1;
while(a++<=1)
while(a++<=2);
printf("%d",a);
}
(A) 1
(B) 4
(C) 5
(D) 6
Ques 4 :
What is the output of following program?
void main(){
int a=2;
switch(a)
{
case 1: printf("A");
case 2: printf("B");
case 3: printf("C");
break;
case 4: printf("D");
default : printf("E");
break;
}
}
(A) B C
(B) B D
(C) B E
(D) error
Ques 5 :
what is the output of following program?
main(){
int a,b;
a=b=100;
scanf("%d%d",a,&b);
//Entered Values are 40 85
printf("%d %d",a,b);
}
(A) 40 85
(B) 0 85
(C) 100 85
(D) 100 100
Ques 6 :
What is the output of following program?
void main(){
printf("1");
goto XYZ;
printf("2");
XYZ:
printf("3");
}
(A) 1 2
(B) 2 3
(C) 1 3
(D) 3 1
Ques 7 :
int testarray[3][2][2] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
What value does testarray[2][1][0] in the sample code above contain?
(A) 3
(B) 5
(C) 7
(D) 11
Ques 8 :
int x[] = { 1, 4, 8, 5, 1, 4 };
int *ptr, y;
ptr = x + 4;
y = ptr - x;
What does y in the sample code above equal?
(A) -3
(B) 0
(C) 4
(D) 4 + sizeof( int )
Ques 9 :
What will be output of the following c program?
#include "stdio.h"
int main()
{
int _ = 5;
int __ = 10;
int ___;
___ = _ + __;
printf("%i", ___);
return 0;
}
(A) 5
(B) 10
(C) 15
(D) Compilation Error
Ques 10 :
What will be output when you will execute following c code?
#include<stdio.h>
int main(){
signed x,a;
unsigned y,b;
a=(signed)10u;
b=(unsigned)-10;
y = (signed)10u + (unsigned)-10;
x = y;
printf("%d %u\t",a,b);
if(x==y)
printf("%d %d",x,y);
else if(x!=y)
printf("%u %u",x,y);
return 0;
}
(A) 10 -10 0 0
(B) 10 -10 65516 -10
(C) 10 65526 0 0
(D) 10 -10 10 -10
Ques 11 :
What is the output of following program?
void main(){
int a=2;
switch(a)
{
case 4: printf("A");
break;
case 3: printf("B");
case default : printf("C");
case 1 : printf("D");
break;
case 5 : printf("E");
}
}
(A) C
(B) C D
(C) E
(D) error
Ques 12 :
What is the output of the following program?
void main(){
int a;
a=1;
while(a<=1)
if(a%2)
printf("%d",a++);
printf("%d",a+10);
}
(A) 2 11
(B) 1 11
(C) 2 12
(D) 1 12
Ques 13 :
What is the output of following program?
void f1(){
extern int g;
static int s=5;
int a;
++g;
a=s++;
printf("%d%d%d",a,s,g);
if(a<=6)
f1();
printf("%d%d%d",a,s,g);
}
void f2(){
static int s;
int a;
a=++s;
++g;
printf("%d%d%d",a,s,g);
if(a<=2)
f2();
printf("%d%d%d",a,s,g);
}
main(){
f1();
f2();
}
(A) 0 5 garbase
(B) 1 6 1
(C) 1 6 2
(D) error
Ques 14 :
What is the output of the following program?
#include "stdio.h"
void fun(int _){
printf("%d",_);
}
main(){
fun(23);
return 0;
}
(A) 0
(B) 23
(C) garbage
(D) error
Ques 15 :
What will be output when you will execute following code?
void main()
{
printf("%d",10?0?20?35:45:55:65);
}
(A) 35
(B) 45
(C) 55
(D) 65
Ques 16 :
What is the output of following program?
void main(){
int i=10;
printf("%d%d%d",++i, i++, ++i);
}
(A) 11 11 13
(B) 13 11 11
(C) 11 12 13
(D) 13 12 11
Ques 17 :
What is the output of following program?
void main(){
int a=2;
switch(a)
{
case4: printf("A");
break;
case3: printf("B");
case2: printf("C");
case1: printf("D");
break;
default: printf("E");
}
}
(A) C
(B) D
(C) C D
(D) E
Ques 18 :
#define MAX_NUM 15
Referring to the sample above, what is MAX_NUM?
(A) MAX_NUM is a precompiler constant.
(B) MAX_NUM is a preprocessor macro.
(C) MAX_NUM is an integer variable.
(D) MAX_NUM is a linker constant.
Ques 19 :
What is the output of following program?
void abc(int a, int b){
printf("%d%d",++a,++b);
}
void main(){
int a=10;
abc(++a,a++);
abc(a++,++a);
printf("%d",a);
}
(A) 13 12 12 13 14
(B) 13 11 14 14 14
(C) 13 11 13 14 14
(D) 13 12 14 14 14
Ques 20 :
What is the output of following program?
void main(){
int i;
i=1;
i=i+2*i++;
printf("%d",i);
}
(A) 3
(B) 4
(C) 5
(D) 6
Submit Answer
Don't Refresh the Page !! ...