C Objective Questions 7

C Langauge Practice Programs-MCQs-Objective-Questions

C Objective Questions 7

C Langauge Practice Programs-MCQs-Objective-Questions95. What is the output of the following program?

void main()
{
int i = 2, j = 3, k, l;
float a,b;
k = i / j * j;
l = j / i * i;
a = i / j * j;
b = j / i * i;
printf(“%d %d %f %f \n” , k,l , a,b);
}


96. What is the output of the following code?

void main()
{
int a=5;
int x;
x = ++++a;
printf(“%d %d”, a,b);
}


97. What is the output of the following code?

void main()
{
int a = 97;
printf(“%d %u %o %x %c”, a,a,a,a,a);
}


98. What is the output of the following code?

void main()
{
int i = 4;
printf(“%d” , i++ * i++);
printf(“%d ” , ++i * ++i);
}


99. What is the output of the following code?

void main()
{
printf(“%d %d %d”, 5<<1, 5>>1, ~5);
}


100. What is the output of the following code?

void main()
{
int var = 5;
printf(“%d” , var++ * var++);
}


Attend Free Demo and Learn   C LANGUAGE ONLINE TRAINING   by Real-Time Expert


101. What is the output of the following code?

void main()
{
printf(“%d %d %d” , 5 | 2 , 5 & 2, 5 ^ 2);
}


102. What is the output of the following code?

void main()
{
int var = 5;
printf(“%f” , var);
}


103. What is the output of the following code?

void main()
{
int var1 = 4, var2 = 6;
var2 = var1++ && printf(“Computer”);
printf(“%d %d” , var1, var2);
}


104. What is the output of the following code?

void main()
{
int x;
x = 10 << 16;
printf(“%d” , x);
}


105. What is the output of the following code?

void main()
{
int var1 = 5, var2 = 10;
var1 = var1 &= var2 && 10;
printf(“%d %d” , var1, var2);
}


Attend Free Demo and Learn   C LANGUAGE ONLINE TRAINING   by Real-Time Expert


106. What is the output of the following code?

void main()
{
int var = 5;
printf(“%d ” , var = ++var == 6);
}


107. What is the output of the following code?

void main()
{
int x;
x = 10 >> 16;
printf(“%d” , x);
}


108. What would be the output of the following code?

void main()
{
char str[ ] = “computer”;
char *str1 = “computer”;
printf(“%d %d” , sizeof(str), sizeof(str1));
}


109. What is the output of the following code?

void main()
{
unsigned int x = -1;
int y;
printf(“%u ” , ++x);
printf(“%u ” , y = -x);
}


110. What is the output of the following code?

void main()
{
printf(“%d %d ” ,sizeof(3.14f), sizeof(3.14));
}


Attend Free Demo and Learn   C LANGUAGE ONLINE TRAINING   by Real-Time Expert


111. What is the output of the following program?

void main()
{
int m = 210000;
printf(” m = %d ” , m);
}


112. What is the output of the following program?

void main()
{
int i = 15, j = 4, m, n;
m = i > 9;
n = j > 2 && j != 2;
printf(“m = %d n = %d\n” , m, n);
}


113. What is the output of the following program?

void main()
{
int x;
x = ~0;
printf(“%d” , x);
}


114. What is the output of the following code?

void main()
{
int var1 = 15, var2 = 10, p, q;
p = var1 > 14;
q = var1 > 8 && var2 == 8;
printf(“p=%d q=%d ” ,p,q);
}


115. What is the output of the following program?

void main()
{
int p;
p = 1;
p = p + 2 * p++;
printf(“%d” , p);
}


Attend Free Demo and Learn   C LANGUAGE ONLINE TRAINING   by Real-Time Expert


116. What is the output of the following code?

void main()
{
int var = 1234.5678;
printf(“%d” , var);
}


117. What is the output of the following program?

void main()
{
printf(“%d ” , -10 & 5 );
}

118. What is t


he output of the following program?

void main()
{
short m = 9, n = 0, p = 0;
p+=n+=m;
p+=n+=m+=-p;
printf(“m=%d n=%d p=%d\n” , m,n,p);
}


119. What is the output of the following code?

void main()
{
printf(“%d ” , printf(“Computer”));
}


120. What is the output of the following program?

void main()
{
int ii = 10;
ii <<= 1;
printf(“%d \n” , ii);
}


Attend Free Demo and Learn   C LANGUAGE ONLINE TRAINING   by Real-Time Expert


121. What is the output of the following code ?

void main()
{
unsigned int ii = -1;
printf(“%d \n” , ii);
printf(“%u \n”, ii * -1);
}


122. What is the output of the following program?

void main()
{
int i = 2, j = 3, k = 0;
int p;
p = (i , k, j);
printf(“%d \n” , p);
}


123. What it the output of the following program?

void main()
{
int x;
x = -~!!~printf(“”);
printf(“%d” , x);
}


124. What is the output of the following program?

void main()
{
int k;
printf(“%o” , k = (~2 | 3) > ~0 ? 7 : 8<<2);
}


125. What is the output of the following program?

void main()
{
printf(“%d” , 900 * 90 / 90);
}


Attend Free Demo and Learn   C LANGUAGE ONLINE TRAINING   by Real-Time Expert


126. What is the output of the following program?

void main()
{
printf(‘%d” , 3 | printf(“hi\n”) || printf(“%s” ,
HELLO\n”));
}


127. What is the outut of the following code?

void main()
{
char ch = ‘a’;
ch = ch – 32;
printf(“%c” , ch);
}


128. What is the output of the program?

void main()
{
printf(“%d”, sizeof(int) ? 1 ? 2 : 3 : 4 );
}


129. What is the output of the following program?

void main()
{
printf(“%d, %d”, sizeof(‘c’), sizeof(100));
}


130. What is the output of the following program?

void main()
{
int i = 100;
printf(“%d”, sizeof(sizeof(i)));
}


Attend Free Demo and Learn   C LANGUAGE ONLINE TRAINING   by Real-Time Expert


131. What is the output of the following program?

void main()
{
int x = 4;
printf(“%d”,printf(“%d%d “,x,x) );
}


132. What is the output of the following program?

void main()
{
printf(“%d”,(float)3/2);
}


133. What is the output of the following program?

void main()
{
float i, j;
scanf(“%f %f”, &i, &j); /* input values 2.5 3.5 */
printf(“%.2f %.3f”, i, j);
}


134. What is the output of the following program?

void main()
{
int i, j, k;
i=10; j=5; k=0;
k=(++i)>(++j)?(i++):(j++);
printf(“%d %d %d”,i, j, k);
}


135. What is the output of the following program?

void main()
{
int y=5;
int z;
z = y++ / y++;
printf(“%d %d”,z,y);
}


Attend Free Demo and Learn   C LANGUAGE ONLINE TRAINING   by Real-Time Expert


136. What is the output of the following program?

void main()
{
int x=3, y=4, z=4;
printf(“ans=%d”,(z>=y>=x? 100 : 200));
}


137. What is the output of the following program?

void main()
{
int i=-1,j=-1,k=0,l=2,m;
m=i++ && j++ && k++ | |l++;
printf(“%d %d %d %d %d”,i,j,k,l,m);
}


138. What is the output of the following program?

void main()
{
int i=5;
printf(“%d”,i=++i ==6);
}


139. What is the output of the following program?

void main()
{
int a;
a = 3+5*5+3;
printf(“%d”,a);
}


140. What is the output of the following program?

void main()
{
double f = 22.5;
printf(“%e”,f);
printf(“%f”,f);
printf(“%g”,f);
}


Attend Free Demo and Learn   C LANGUAGE ONLINE TRAINING   by Real-Time Expert


141. What is the output of the following code?

void main()
{
int i=400, j=300 , k = 500;
printf(“%d %d %d”);
}


142. What is the output of the following code?

void main()
{
printf(“\n-Three”) + printf(“\nfour”) * printf(“\nfive”) –
printf(“\nsix”);
}


143. What is the output of the following code?

void main()
{
printf(“hai”)||printf(“bye”);
}


144. What is the output of the following code?

void main()
{
int x, y, z;
x = 5; y = 6; z = 7;
z == x <= y;
printf(“\n%d”,z);
}


145. Which of the following format specifier is used to print hexadecimal values?

A. %hx
B.%ox
C.%x
D.%hex


Attend Free Demo and Learn   C LANGUAGE ONLINE TRAINING   by Real-Time Expert


146. What is the output of the following code?

void main()
{
int a=b=1;
a=a++ + ++b;
b=b++ + ++a;
printf(“%d %d”, a,b);
}


147. What is the output of the following code?

void main()
{
int n = 12, k;
printf(“%d” , (k = sizeof(n + 12.0)) ++ );
}


148. What is the output of the following program?

void main()
{
int a = 3, b = 5, c = 1;
b = ++b && –c || (a = !a);
a = c || a–;
printf(“%d %d %d” , a,b,c);
}


149. What is the output of the following code?

void main()
{
float f = (char) 5.23f;
printf(“%0.2f” , f);
}


150. What is the output of the following program?

void main()
{
char a = ‘\101’;
printf (“%c \n”,a);
}


151. What is the output of the following program?

void main()
{
int a,b;
a=b=20;
scanf(“%d %d”,a,&b); //input 10 5
printf(“entered values are %d %d”,a,b);
}


Attend Free Demo and Learn   C LANGUAGE ONLINE TRAINING   by Real-Time Expert

Share this post