Time remaining
:
:
Test Status
CRANDOMTEST
Ques 1 :
What will be the output of the following program?
main()
{
printf(â??%câ??,â??Gyantonicâ??[4]);
}
(A) G
(B) n
(C) t
(D) none of these
Ques 2 :
What is the output of the following program?
void main(){
printf("%d%d",100,200,300);
}
(A) 100 200
(B) 200 300
(C) 300 200
(D) 100 200 300
Ques 3 :
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 4 :
What is the output of the following code?
#include"stdio.h"
main()
{
int i;
for(i=0;i<5;i++)
{
static int a=0;
int b=0;
a++;
b++;
printf("%d %d",a,b);
}
return 0;
}
(A) 1 1 2 1 3 1 4 1
(B) 1 1 2 1 3 1 4 1 5 1
(C) 1 0 2 0 3 1 4 1 5 1
(D) 0 1 2 0 3 1 4 1 5 1
Ques 5 :
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 6 :
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 7 :
What will be the output of the following program?
main()
{
printf(3+â??Gyantonicâ??+4);
}
(A) ntonic
(B) tonic
(C) ic
(D) nic
Ques 8 :
what is the output of following program?
void main(){
int a;
a=1;
while(a-->=1)
while(a-->=0);
printf("%d",a);
}
(A) 3
(B) -3
(C) 0
(D) error
Ques 9 :
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 10 :
Which of the following program structure/component/statement is not an example for implementation of modularization ?
(A) DLL
(B) Functions
(C) type casting
Ques 11 :
What is the output of the following program?
void main(){
a=3.5;
printf("%d",a);
}
(A) 3.5
(B) 3
(C) error
(D) garbage
Ques 12 :
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 13 :
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 14 :
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 15 :
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 16 :
What is the output of following program?
void main(){
int a;
a=~0;
printf("%d",a);
}
(A) 0
(B) 1
(C) -1
(D) none of these
Ques 17 :
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 18 :
What will be the output
main()
{
int i;
i = 10;
if(i == 20 || 30)
{
printf("True");
}
else
{
printf("False");
}
}
(A) True
(B) False
(C) Syntax Error
(D) Run time Error
Ques 19 :
what is the output of following program?
void main(){
printf("%d%d",47%5,47%-5);
printf("%d%d%d",-47%5,-47%-5,5%7);
}
(A) 2,-2,-2,-2,5
(B) 2,2,-2,-2,5
(C) 2,-2,2,-2,5
(D) 2,2,-2,-2,0
Ques 20 :
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
Submit Answer
Don't Refresh the Page !! ...