Time remaining
:
:
Test Status
CTEST5
Ques 1 :
What is the output of following program?
#include "stdio.h"
main(){
extern int a=5;
printf("%d",a);
return 0;
}
(A) 5
(B) 0
(C) error
(D) none of these
Ques 2 :
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 3 :
what is the output of following program?
void main(){
printf("One");
if(2>1)
printf("Two");
else
printf("Three");
printf("Four");
}
(A) One Two Three
(B) Two Three Four
(C) One Two Four
(D) One Three Four
Ques 4 :
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 5 :
what is the output of following program?
void main(){
int a;
a=1;
while(a-->=1)
while(a-->=0);
printf("%d",a);
}
(A) 3
(B) -3
(C) 0
(D) error
Ques 6 :
what is the output of following program?
void main(){
int a=1;
void xyz(int , int);
xyz(++a,a++);
xyz(a++,++a);
printf("%d",a);
}
void xyz(int x, inty){
printf("%d%d",x,y);
}
(A) 3 1 3 4 5
(B) 3 1 4 4 5
(C) 3 1 4 4 4
(D) 3 1 4 5 5
Ques 7 :
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 8 :
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 9 :
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 10 :
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 11 :
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 12 :
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 13 :
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 14 :
What is the output of the following program?
void main(){
int a;
a=1;
a++ * ++a;
printf("%d",a);
}
(A) 3
(B) 4
(C) 6
(D) 2
Ques 15 :
What is the output of the following program?
void main(){
int a,b;
a=b=1;
a=a++ + ++b;
b=b++ + ++a;
printf("%d%d",a,b);
}
(A) 4 7
(B) 5 7
(C) 4 8
(D) 5 8
Ques 16 :
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 17 :
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 18 :
What is the output of the following program?
void main(){
int a;
a=1;
while(a<=1)
if(a%2)
printf("%d",a++);
printf("%d",a+10);
}
(A) 2 11
(B) 1 11
(C) 2 12
(D) 1 12
Ques 19 :
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 20 :
Can a program be invoked from another program ?
(A) True
(B) False
Submit Answer
Don't Refresh the Page !! ...