Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Placement Questions C Operators Viva Interview for Engineering Freshers Basics Tutorials

1.Which of the following is not a compound assignment operator?
a) /=
b) +=
c) %=
d) == 
ANSWER: d) ==

2.What will be the output of the following Code snippet?
Y = 5;
if (! Y > 10)
X = Y + 3;
else
X = Y + 10;
printf(“ X = %d Y = %d”, X, Y);
a) The program will print X = 15 Y = 5 
b) The program will print X = 15 Y = 0
c) The program will print X = 8 Y = 5
d) The program will print X = 3 Y = 0
ANSWER: a) The program will print X = 15 Y = 5



3.Which of the following statement is correct about the code snippet given below?
num = 5;
printf( “%d”, ++num++ );
a) The code will print 5
b) The code will print 6
c) The code will result in L – value required 
d) The code will result in R – value required
ANSWER: c) The code will result in L – value required

4.Which of the following statement is correct about the code snippet given below?
#include < stdio.h>
int main()
{
float z = 12.35, c = 10;
if( ++z%10 -z)
c += z; 
else
c - = z;
printf( “%f %f”, z, c);
return 0;
}
a) The program will result in compile time error 
b) The program will print 12.35 22.35
c) The program will print 13.35 22.35
d) The program will print 1.35 11.35
ANSWER: a) The program will result in compile time error

5.Which of the following statement is correct about the code snippet given below?
#include < stdio.h>
int main()
{
int n = 12, k;
printf(“%d”, (k = sizeof( n + 12.0))++);
return 0;
}
a) The code will print 17
b) The code will print 5
c) The code will result compile time error 
d) The code will print 4
ANSWER: c) The code will result compile time error
CONTINUE READING »


This post first appeared on IngenuityDias, please read the originial post: here

Share the post

Placement Questions C Operators Viva Interview for Engineering Freshers Basics Tutorials

×

Subscribe to Ingenuitydias

Get updates delivered right to your inbox!

Thank you for your subscription

×