Time remaining
:
:
Test Status
CRANDOMTEST
Ques 1 :
what is the output of following program?
void main(){
int a;
float f;
a=12/5;
f=12/5;
printf("%d%f",a,f);
}
(A) 2,2.000000
(B) 2,2.00
(C) 2,2
(D) none of these
Ques 2 :
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 3 :
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 4 :
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 5 :
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 6 :
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 7 :
Given the following program fragment
main ()
{
int i, j, k;
i = 3;
j =2*(i++);
k =2*(++i);
}
which one of the given option is correct?
(A) j = 6, k = 10.
(B) i = 5, k = 6
(C) j = 6, k = 8.
(D) i = 4, j = 6.
Ques 8 :
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 9 :
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 10 :
How many times the below loop will get executed?
main()
{
int i,j;
i = 10;
for (j=i==10 ; j<=10 ; j++)
{
printf("\n%d",j);
}
}
(A) 1
(B) 10
(C) 11
(D) Compilation Error
Ques 11 :
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 12 :
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 13 :
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) A B C
(B) A B C E
(C) A B C D E
(D) error
Ques 14 :
What will be output when you will execute following code?
void main(){
printf("%d",-2&&2);
}
(A) 0
(B) 1
(C) -2
(D) 2
Ques 15 :
What is the output of the following program?
void xyz(int p1, int *p2){
++p1;
++*p2;
printf("%d%d",p1,*p2);
}
void main(){
int a=10;
xyz(a++,++*(&a));
xyz(a++,++*(&a));
printf("%d",a);
}
(A) 10 11 13 14 14
(B) 11 12 14 15 15
(C) 12 13 15 16 16
(D) 11 12 13 14 14
Ques 16 :
What is the output of following program?
void main(){
int a;
a=453<<16;
printf("%d",a);
}
(A) 0
(B) 1
(C) -1
(D) none of these
Ques 17 :
What is the output of following program?
void main(){
int a=2;
switch(a)
{
case 1: printf("A");
break;
case 2: printf("B");
continue;
case 3: printf("C");
break;
case 4; printf("D");
default: printf("E");
}
}
(A) B E
(B) B C E
(C) B C D E
(D) error
Ques 18 :
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 19 :
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 20 :
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
Submit Answer
Don't Refresh the Page !! ...