Time remaining
:
:
Test Status
CRANDOMTEST
Ques 1 :
What will be the output of the following program
main( )
{
int gyan[] = { 10, 20, 30, 40, 50 };
int i, *ptr ;
ptr = gyan;
for ( i = 0 ; i <4 ; i++ )
{
fun(ptr++);
printf ( â??\n%dâ??, *ptr ) ;
}
}
void fun(int *i)
{
*i = *i + 1;
}
(A) 11 21 31 41
(B) 20 30 40 50
(C) 21 31 41 51
(D) 10 20 30 40
Ques 2 :
What will be the output of the following program
main( )
{
int pskills[] = { 10, 20, 30, 40, 50 };
int i, *ptr ;
ptr = pskills;
for ( i = 0 ; i <4 ; i++ )
{
fun(ptr++);
printf ("\n%", *ptr ) ;
}
}
void fun(int *i)
{
*i = *i + 1;
}
(A) 11 21 31 41
(B) 20 30 40 50
(C) 21 31 41 51
(D) 10 20 30 40
Ques 3 :
11 ^ 5
What does the operation shown above produce?
(A) 1
(B) 6
(C) 8
(D) 14
Ques 4 :
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 5 :
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 6 :
What is the output of the following program?
void main(){
int a=1;
while(a++<=1)
while(a++<=2);
printf("%d",a);
}
(A) 2
(B) 3
(C) 4
(D) 5
Ques 7 :
What is the output of following program?
void main(){
int a=1;
a=a<<15;
printf("%d",a);
}
(A) 32767
(B) -32767
(C) 32768
(D) -32768
Ques 8 :
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 9 :
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 10 :
what is the output of following program?
void main(){
int a;
a=100;
printf("%d%d",++a,a++);
}
(A) 101 101
(B) 101 102
(C) 102 100
(D) 102 101
Ques 11 :
What is the output of the following code?
void main()
{
int i;
i=0;
if(i=15,10,5)
printf("Programing %d",i);
else
printf("Skills %d",i);
getch ();
}
(A) Skills 15
(B) Programing 5
(C) Programing 15
(D) Skills 5
Ques 12 :
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 13 :
What is the output of the following program?
void main(){
int a;
a=3+5*5+3;
printf("%d",a);
}
(A) 43
(B) 64
(C) 31
(D) none of these
Ques 14 :
What will be the output
main()
{
char *ptr = "Pskills.org";
char a =
printf("%c", ++*ptr++);
}
(A) Compilation Error
(B) Q
(C) P
(D) a
Ques 15 :
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 16 :
How many times the below loop will get executed?
main()
{
int i,j;
i = 10;
for (j=i==10 ; j<=10 ; j++)
{
printf(â??\n%dâ??,j);
}
}
(A) 1
(B) 10
(C) 11
(D) infinite loop
Ques 17 :
What will be output of following program?
void convention(int,int,int);
int main(){
int a=5;
convention(a,++a,a++);
return 0;
}
void convention(int p,int q,int r){
printf("%d %d %d",p,q,r);
}
(A) 5 6 5
(B) 6 7 5
(C) 7 7 5
(D) 6 6 5
Ques 18 :
What is the output of the following program?
void main(){
int a;
a=100>90>80;
printf("%d",a);
}
(A) 0
(B) 1
(C) error
(D) none of these
Ques 19 :
What is the output of following program?
void main(){
printf("%d%d%d",10<<1, 10>>1, ~10);
printf("%d%d%d",10^20, 10|20, 10&20);
}
(A) 20 5 -11 30 30 1
(B) 20 5 -9 30 30 0
(C) 5 20 -11 30 30 0
(D) 20 5 -11 30 30 0
Ques 20 :
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
Submit Answer
Don't Refresh the Page !! ...