Time remaining
:
:
Test Status
CTEST6
Ques 1 :
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 2 :
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 3 :
What is the output of following program?
void main(){
int a;
a=1;
while(a<=1)
if(a%2)
printf("%d",a++);
else
printf("%d",++a);
printf("%d",a+10);
}
(A) 0 11
(B) 0 12
(C) 1 11
(D) 1 12
Ques 4 :
What will be the output of the following program
main( )
{
int gyan[] = { 10, 20, 30, 40, 50 };
int i, *ptr ;
ptr = gyan;
for ( i = 0 ; i <4 ; i++ )
{
fun(ptr++);
printf ( â??\n%dâ??, *ptr ) ;
}
}
void fun(int *i)
{
*i = *i + 1;
}
(A) 11 21 31 41
(B) 20 30 40 50
(C) 21 31 41 51
(D) 10 20 30 40
Ques 5 :
What will be the output of the following program
void main( ){
int a=10;
printf("%d",a);
{
int a=20;
printf("%d",a);
}
printf("%d",a);
}
(A) 10 10
(B) 20 10
(C) 10 20 10
(D) 10 10 10
Ques 6 :
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 7 :
What will be output of following program?
void convention(int,int,int);
int main(){
int a=5;
convention(a,++a,a++);
return 0;
}
void convention(int p,int q,int r){
printf("%d %d %d",p,q,r);
}
(A) 5 6 5
(B) 6 7 5
(C) 7 7 5
(D) 6 6 5
Ques 8 :
What is the output of following program?
void main(){
int a=89;
int p;
p=&a;
*(int*)p=8;
printf("%d",a);
return 0;
}
(A) 7
(B) 8
(C) 89
(D) error
Ques 9 :
What is the output of following program?
void f1(){
int a=0;
++a;
printf("%d",a);
}
main(){
int a=10;
f1();
f1();
f1();
printf("%d",a);
return 0;
}
(A) 0 1 1 10
(B) 10 0 1 10
(C) 1 2 3 4
(D) 1 1 1 10
Ques 10 :
What is the output of following program?
void f1(){
static int s=5;
++s;
printf("%d",s);
}
main(){
f1();
f1();
printf("%d",s);
}
(A) 6 6 6
(B) 6 7 7
(C) 6 7 6
(D) error
Ques 11 :
What is the output of following program?
void f1(){
static int s=5;
++s;
printf("%d",s);
}
main(){
f1();
f1();
}
(A) 5 6
(B) 6 6
(C) 6 7
(D) 5 5
Ques 12 :
What is the output of following program?
void main(){
int a;
a=10;
do
while(a++<10);
while(a++<=11);
printf("%d",a);
}
(A) 12
(B) 13
(C) 14
(D) nothing display on screen.
Ques 13 :
What is the output of following program?
void main(){
int a,b;
for(a=b=10;a;printf("%d%d%d",a,b))
a=b++<=12;
printf("%d%d",a+10,b+10);
}
(A) 1 12 1 12 1 13 0 14 10 24
(B) 1 11 1 11 1 13 0 14 10 24
(C) 1 11 1 12 1 13 0 14 10 24
(D) 1 11 1 12 1 14 0 14 10 24
Ques 14 :
What is the output of following program?
void main(){
int a;
a='a'>'A';
printf("%d",a);
}
(A) 0
(B) 1
(C) garbage
(D) none of these
Ques 15 :
What is the output of following program?
void main(){
printf("%d%d",sizeof(10),sizeof(5,5));
}
(A) 2 2
(B) 2 4
(C) 2 6
(D) 2 8
Ques 16 :
What is the output of following program?
void main(){
int i;
for(i=1;i++<=1;i++)
i++;
printf("%d",i);
}
(A) 4
(B) 5
(C) 6
(D) nothing display on screen
Ques 17 :
What is the output of following program?
void main(){
int i;
for(i=1;i++<=1;i++)
for(i++;i++<=6;i++)
i++;
printf("%d",i);
}
(A) 11
(B) 12
(C) 13
(D) none of these
Ques 18 :
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
Ques 19 :
What is the output of following program?
void xyz(int b){
++b;
}
void main(){
int b=200;
xyz(b);
xyz(b);
printf("%d",b);
}
(A) 200
(B) 201
(C) 202
(D) 203
Ques 20 :
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
Submit Answer
Don't Refresh the Page !! ...