Time remaining
:
:
Test Status
CRANDOMTEST
Ques 1 :
What is the output of the following code?
#include "stdio.h"
extern int a;
main(){
printf("\n a=%d",a);
return 0;
}
int a=5;
(A) a=0
(B) a=5
(C) a=garbage value
(D) error
Ques 2 :
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 3 :
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 4 :
What will be output when you will execute following code?
void main(){
int a,b;
a=15; b=25;
a=a+b;
b=a-b;
a=a-b;
printf("%d%d",a,b);
}
(A) 5 25
(B) 25 15
(C) 25 5
(D) 25 40
Ques 5 :
#define MAX_NUM 15
Referring to the sample above, what is MAX_NUM?
(A) MAX_NUM is a precompiler constant.
(B) MAX_NUM is a preprocessor macro.
(C) MAX_NUM is an integer variable.
(D) MAX_NUM is a linker constant.
Ques 6 :
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 7 :
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 8 :
What will be printed as the result of the operation below:
int x;
int modifyvalue()
{
return(x+=10);
}
int changevalue(int x)
{
return(x+=1);
}
void main()
{
int x=10;
x++;
changevalue(x);
x++;
modifyvalue();
printf("First output:%dn",x);
x++;
changevalue(x);
printf("Second output:%dn",x);
modifyvalue();
printf("Third output:%dn",x);
}
(A) 12, 12, 12
(B) 12, 12, 13
(C) 12, 13, 13
(D) 13, 13, 13
Ques 9 :
What are storage classes in 'C' language? choose multiple-
a. auto keyword
b. static keyword
c. register keyword
d. extern keyword
e. automatic
f. static
(A) a,b,c
(B) a,b,c,d
(C) e,f
(D) none of these
Ques 10 :
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 11 :
11 ^ 5
What does the operation shown above produce?
(A) 1
(B) 6
(C) 8
(D) 14
Ques 12 :
What will be printed as the result of the operation below:
#define swap(a,b) a=a+b;b=a-b;a=a-b;
void main()
{
int x=5, y=10;
swap (x,y);
printf("%d %d",x,y);
swap2(x,y);
printf("%d %d",x,y);
}
int swap2(int a, int b)
{
int temp;
temp=a;
b=a;
a=temp;
return 0;
}
(A) 5,10
(B) 10,5
(C) 0,5
(D) 10,0
Ques 13 :
How many times the below loop will run
main()
{
int i;
i=0;
do
{
--i;
printf("%d",i);
i++;
}
while(i>=0);
}
(A) 1
(B) Infinite
(C) 0
(D) Compilation Error
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 i;
i=1;
i=i+2*i++;
printf("%d",i);
}
(A) 3
(B) 4
(C) 5
(D) 6
Ques 16 :
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 17 :
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 18 :
what is the output of following program?
main(){
int a,b;
a=b=100;
scanf("%d%d",a,&b);
//Entered Values are 40 85
printf("%d %d",a,b);
}
(A) 40 85
(B) 0 85
(C) 100 85
(D) 100 100
Ques 19 :
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 20 :
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
Submit Answer
Don't Refresh the Page !! ...