Time remaining
:
:
Test Status
CRANDOMTEST
Ques 1 :
What the below statement will print if a=10 and b = 20?
printf("%d",a==b);
(A) 20
(B) 10
(C) 1
(D) 0
Ques 2 :
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 3 :
what is the output of following program?
void main(){
int a=80;
if(a++>80)
printf("welcome%d",a);
else
printf("hello%d",a);
}
(A) hello 81
(B) welcome 81
(C) hello 80
(D) welcome 80
Ques 4 :
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 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 will be output when you will execute following code?
#include "stdio.h"
int main(){
char a=250;
int expr;
expr= a+ !a + ~a + ++a;
printf("%d",expr);
return 0;
}
(A) 249
(B) 250
(C) -6
(D) 0
Ques 7 :
What is the output of the following code?
#include "stdio.h"
int a;
main(){
printf("\n a= %d",a);
return 0;
}
(A) a=0
(B) a=garbage value
(C) error
(D) none of these
Ques 8 :
What value of c will get printed
main()
{
int a,b,c;
a=10;
b=20;
c=printf("%d",a)+ ++b;
printf("%d",c);
}
(A) 23
(B) 22
(C) 30
(D) Compilation Error
Ques 9 :
What will be printed as the result of the operation below:
main()
{
int x=20,y=35;
x=y++ + x++;
y= ++y + ++x;
printf("%d%d",x,y);
}
(A) 5 7 8 4
(B) 5 7 9 4
(C) 5 8 9 4
(D) 5 7 9 5
Ques 10 :
How many times the below loop will get executed?
main()
{
int i;
for(i=20, i=10; i<=20; i++)
{
printf("\n %d", i);
}
}
(A) 1
(B) Run time Error
(C) 11
(D) Compilation Error
Ques 11 :
How many times main() will get called?
main()
{
printf("\n Main Called Again");
main();
}
(A) 1
(B) 100
(C) main can not be called recursively
(D) Infinite
Ques 12 :
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 13 :
What will be printed as the result of the operation below:
main()
{
int x=5;
printf("%d,%d,%d",x,x< <2,x>>2);
}
(A) 1
(B) 5,20,1
(C) 0
(D) Compilation Error
Ques 14 :
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 12 13 13
(B) 11 12 13 13 14
(C) 10 11 12 12 13
(D) 11 12 13 14 14
Ques 15 :
What is the output of the following code?
#include "stdio.h"
extern int a;
main(){
printf("\na=%d",a);
return 0;
}
(A) a=0
(B) a=garbage value
(C) error
(D) none of these
Ques 16 :
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 17 :
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 18 :
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 19 :
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 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 !! ...