Time remaining
:
:
Test Status
CRANDOMTEST
Ques 1 :
What the below statement will print if a=10 and b = 20?
printf("%d",a==b);
(A) 20
(B) 10
(C) 1
(D) 0
Ques 2 :
How many times the below loop will get executed?
main()
{
int i;
for(i=20, i=10; i<=20; i++)
{
printf("\n %d", i);
}
}
(A) 1
(B) Run time Error
(C) 11
(D) Compilation Error
Ques 3 :
What is the output of the following code?
#include "stdio.h"
extern int a;
main(){
printf("\n a=%d",a);
return 0;
}
int a;
(A) a=0
(B) error
(C) nothing display on screen
(D) none of these
Ques 4 :
What will be printed as the result of the operation below:
main()
{
int x=10, y=15;
x = x++;
y = ++y;
printf("%d %d",x,y);
}
(A) 10, 16
(B) 11, 16
(C) 10, 16
(D) 11, 15
Ques 5 :
what is the output of following program?
main(){
auto a;
register r;
static s;
extern e;
printf("%d",sizeof a);
printf("%d",sizeof r);
printf("%d",sizeof s);
printf("%d",sizeof e);
return 0;
}
(A) 2 4 2 4
(B) 2 2 4 2
(C) 2 2 2 2
(D) 2 4 2 2
Ques 6 :
What will be output when you will execute following code?
#include "stdio.h"
int main(){
char a=250;
int expr;
expr= a+ !a + ~a + ++a;
printf("%d",expr);
return 0;
}
(A) 249
(B) 250
(C) -6
(D) 0
Ques 7 :
What will be printed as the result of the operation below:
main()
{
int x=5;
printf("%d,%d,%d",x,x< <2,x>>2);
}
(A) 1
(B) 5,20,1
(C) 0
(D) Compilation Error
Ques 8 :
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 9 :
What will be output of the following program?
#include<stdio.h>
int main(){
int x;
x=10,20,30;
printf("%d",x);
return 0;
}
(A) 10
(B) 30
(C) 30
(D) 0
Ques 10 :
What will be the output
main()
{
int i;
i = 10;
printf("%d\t",5,6);
printf("%d", i , i++);
}
(A) 5 11
(B) 6 10
(C) 6 11
(D) 5 10
Ques 11 :
What is the output of the following code?
void main()
{
int i;
i=0;
if(i=15,10,5)
printf("Programing %d",i);
else
printf("Skills %d",i);
getch ();
}
(A) Skills 15
(B) Programing 5
(C) Programing 15
(D) Skills 5
Ques 12 :
What will be output when you will execute following code?
static extern int a=5;
static int b=6;
main()
{
printf("%d",a);
printf("%d",b);
return 0;
}
(A) a=0 b=6
(B) a=5 b=0
(C) a=5 b=6
(D) none of these
Ques 13 :
What will be output when you will execute following code?
void main(){
int a;
a=5;
if(a=15)
printf("welcome%d",a);
else
printf("hello%d"a);
}
(A) welcome 5
(B) welcome 15
(C) hello 5
(D) hello 15
Ques 14 :
What will be output of following program?
#include<stdio.h>
int main()
{
int a = 320;
char *ptr;
ptr = (char *)&a;
printf("%d",*ptr);
return 0;
}
(A) 2
(B) 320
(C) 64
(D) Compilation Error
Ques 15 :
How many times the below loop will get executed?
main()
{
int i;
for(i=9;i;i=i-2)
{
printf("\n%d",i);
}
}
(A) 5
(B) 6
(C) Compilation Error
(D) Infinite
Ques 16 :
What is the output of the following program?
void main(){
int a;
a=1;
a++ * ++a;
printf("%d",a);
}
(A) 3
(B) 4
(C) 6
(D) 2
Ques 17 :
What is the output of the following code?
#include "stdio.h"
extern int a=5;
main(){
void fun();
printf("\n a=%d",a);
fun();
return 0;
}
int a;
void fun(){
printf("\n in fun a=%d",a);
}
(A) a=0 in fun a=5
(B) a=5 in fun a=0
(C) a=5 in fun a=5
(D) error
Ques 18 :
What is the output of the following program?
void main(){
int a;
a=100>90>80;
printf("%d",a);
}
(A) 0
(B) 1
(C) error
(D) none of these
Ques 19 :
What is the output of the following code?
#include "stdio.h"
main(){
static int s;
++s;
printf("%d",s);
if(s<=3)
main();
printf("%d",s);
return 0;
}
(A) 1 2 3 4 4 4 4 4
(B) 0 1 2 3 4 4 4 4
(C) 1 2 3 3 4 4 4 4
(D) 0 1 3 4 4 4 4 4
Ques 20 :
What is the output of following program?
void abc(int a){
++a;
}
void main(){
int a=10;
abc();
abc();
printf("%d",a);
}
(A) 10
(B) 11
(C) 12
(D) 13
Submit Answer
Don't Refresh the Page !! ...