Time remaining
:
:
Test Status
CRANDOMTEST
Ques 1 :
Which one of the following functions is the correct choice for moving blocks of binary data that are of arbitrary size and position in memory?
(A) memset()
(B) memcpy()
(C) strncpy()
(D) memmove()
Ques 2 :
what is the output of following program?
void main(){
int a;
a=10;
a*=10+2;
printf("%d",a);
}
(A) 102
(B) 100
(C) 120
(D) 22
Ques 3 :
What is the output of following program?
void main(){
int a=100;
printf("%d %u %o %x", a,a,a,a);
}
(A) 100 100 0000144 0x0064
(B) 100 100.00 0000144 0x0064
(C) 100 100 0000144 0x0032
(D) 100 100 0000127 0x0064
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 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 6 :
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 7 :
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 8 :
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 9 :
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 10 :
What will be the output of the following program if the base address of array is 100.
main()
{
int gyan[] = { 1,2,3,4,5 };
int i,*ptr ;
ptr = gyan;
for(i = 0; i<=4 ; i++)
{
print("\n %d", *ptr++);
}
}
(A) 1 2 3 4 5
(B) 2 3 4 5
(C) 100 101 102 103
(D) 101 102 103 104
Ques 11 :
Which one of the given option is correct?
void main()
{
int i;
i=2;
pskills:
printf("%d",i);
i=i+2;
if(i<=20)
goto pskills;
}
(A) 3 5 7 9 ....... 21 23
(B) 2 4 6 8 ....... 20
(C) 3 5 7 9 ....... 21
(D) 2 4 6 8 ....... 20 22
Ques 12 :
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 13 :
What is the output of following program?
void abc(int a){
++a;
printf("%d",a);
}
void main(){
int a=10;
abc(++a);
abc(a++);
printf("%d",a);
}
(A) 11 12 12
(B) 11 12 13
(C) 12 12 12
(D) 12 12 13
Ques 14 :
What is the output of following program?
void main(){
float a;
a=8.5;
if(a==8.5)
printf("1");
else
printf("2");
}
(A) 1
(B) 2
(C) error
(D) none of these
Ques 15 :
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 16 :
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 17 :
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 18 :
what is the output of following program?
void main(){
float a;
a=6.7;
if(a==6.7)
printf("A");
else
printf("B");
}
(A) A
(B) B
(C) error
(D) nothing display on screen
Ques 19 :
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 20 :
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.
Submit Answer
Don't Refresh the Page !! ...