Time remaining
:
:
Test Status
CRANDOMTEST
Ques 1 :
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 2 :
What is the output of the following program?
void main(){
int a,b;
a=b=10;
while(a)
{
a=b++<=13;
printf("%d%d",a,b);
}
printf("%d%d",a+10,b+10);
}
(A) 1 11 1 12 1 13 1 14 0 15 a=10 b=25
(B) 0 11 1 12 1 13 1 14 0 15 a=10 b=25
(C) 1 11 1 12 1 13 1 14 0 15 a=11 b=25
(D) 0 11 1 12 1 13 1 14 0 15 a=10 b=25
Ques 3 :
What is the output of the following code?
void main(){
printf("%d%d%d",50,100);
}
(A) 50,100
(B) 50,100,garbage
(C) 50,100,0
(D) 0,50,100
Ques 4 :
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 5 :
switch(option)
{
case 'H' : printf("Hello");
case 'W' : printf("Welcome");
case 'B' : printf("Bye");
break;
}
what would be the output if option = 'H' ?
(A) Hello
(B) Hello Welcome
(C) Hello Welcome Bye
(D) None of the above
Ques 6 :
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 7 :
What is the output of following program?
void f1(){
extern int g;
static int s=5;
int a;
++g;
a=s++;
printf("%d%d%d",a,s,g);
if(a<=6)
f1();
printf("%d%d%d",a,s,g);
}
void f2(){
static int s;
int a;
a=++s;
++g;
printf("%d%d%d",a,s,g);
if(a<=2)
f2();
printf("%d%d%d",a,s,g);
}
main(){
f1();
f2();
}
(A) 0 5 garbase
(B) 1 6 1
(C) 1 6 2
(D) error
Ques 8 :
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 9 :
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 10 :
What will be printed as the result of the operation below:
main()
{
char s1[]="Cisco"
char s2[]= "systems";
printf("%s",s1);
}
(A) system
(B) error
(C) Cisco
(D) Compilation fail
Ques 11 :
What will be output when you will execute following c code?
#include<stdio.h>
int main(){
signed x,a;
unsigned y,b;
a=(signed)10u;
b=(unsigned)-10;
y = (signed)10u + (unsigned)-10;
x = y;
printf("%d %u\t",a,b);
if(x==y)
printf("%d %d",x,y);
else if(x!=y)
printf("%u %u",x,y);
return 0;
}
(A) 10 -10 0 0
(B) 10 -10 65516 -10
(C) 10 65526 0 0
(D) 10 -10 10 -10
Ques 12 :
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 13 :
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 14 :
What will be output when you will execute following code?
void main(){
if(!10>-10)
printf("C");
else
printf("C++");
}
(A) C
(B) C++
(C) nothing display on screen
(D) none of these
Ques 15 :
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 16 :
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 17 :
How many times the while loop will get executed?
main ( )
{
int a = 1 ;
while ( a <= 100) ;
{
printf ( â??%dâ??, a++ ) ;
}
}
(A) 100
(B) 1
(C) 0
(D) Infinite
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(){
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 20 :
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
Submit Answer
Don't Refresh the Page !! ...