Note 1

Take Note:

Take a note while surfing.





Note With Ink

Give your Note a Colorful Tag.




Easy to Access

Stay on same information and in Sync wherever you are.

Note 2

Take Note:

Organize your information,It may take Shape.





Think With Ink

Differ your Content by Color.




Easy to Access

Easy to pull up your content from anywhere anytime.

Note 3

Take Note:

Don't Let information to miss,Because it take shape





Note With Ink

Simple an Easy Way to take a note.




Easy to Access

Get the same in next visit.


Please wait...

C Programming :: C Preprocessor

Home > C Programming > C Preprocessor > General Questions

11. What is the output of the following 'C' program ?

#define FALSE -1
#define TRUE 1
#define NULL 0
int main()
{
if(NULL)
puts("NULL");
else if(FALSE)
puts("TRUE");
else
puts("FALSE");
return 0;
}

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace


Tags:  No Tags on this question yet!

12. What is the output of the following 'C' program ?

#include
#define swap(a,b,c) c = a; a = b; b = c;
int main()
{
int a = 3,b = 5;
int temp;
swap(a,b,temp)
printf("%d %d %d\n",a,b,temp);
}

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace


Tags:  No Tags on this question yet!

13. What is the output of the following 'C' program ?

#include
#define swap(a,b,c) c = a; a = b; b = c
int main()
{
int a = 3,b = 5;
int temp;
swap(a,b,temp);
printf("%d %d %d\n",a,b,temp);
}

Answer: Option D

Explanation:

Here is no explanation for this answer

Workspace


Tags:  No Tags on this question yet!

14. What are the values printed by the following program?

#define dprint(expr) printf(#expr "=%d\n",expr)

main()
{
int x=7;
int y=3;
dprintf(x/y);
}

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace


Tags:  Wipro

15. Preprocessor does not do which one of the following

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace


Tags:  Wipro

16.  What will be output of the following "c" code?

#include
#define SQR(x) x*x
void main()
{
int a =5, b, c;
b = SQR(a++);
c = SQR(++a);
printf("%d %d", b, c);
}

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace


Tags:  No Tags on this question yet!

17. What will be output of the following "c" code?

#include
#define a 10
void main( )
{
#define a 50
printf("%d",a);
}

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace


Tags:  No Tags on this question yet!

18. What will be output of the following "c" code?

#include
#define SQR(a) a*a
void main ()
{
int x = 5, y;
y = 25/SQR(x);
printf("%d", y);
}

Answer: Option A

Explanation:

Here, the #define will replace SQR(x) with x*x. The value given here is X=5. Then,y= 25/SQR(x)= 25/x*x, then apply bodmas rule here so the value of y will be 25. Hence, 25 will be printed.

Workspace


Tags:  No Tags on this question yet!

19. What is the value of variable POLYGON?

void main ()
{
int POLYGON, L, B;
L = B = 2;
POLYGON= (L = = B)? 1:0;
}

Answer: Option D

Explanation:

Ternary operator(? Value 1: Value 2), if condition is true it gives Value 1 otherwise Value 2. But, here main is of void type.

Workspace


Tags:  No Tags on this question yet!

20. # define max (x, y)x = (x > y)? x : y is a macro definition.
Which can find the maximum of two numbers x and y if

Answer: Option B

Explanation:

Here is no explanation for this answer

Workspace


Tags:  No Tags on this question yet!



Most Popular Qs.

Latest MCQ Qs.