what is the output?
#define fun(a,b,t) (g ##t=(a),(a)=(b),(b)=g##t)
float gfloat;
main()
{
float a=1.12,b=3.14;
fun (a,b,float);
printf("na=%4.2f,b=%4.2f",a,b);
}
A)Error in Defining Macro
B)a=1.12,b=3.14
C)a=3.14,b=1.12
D)None of the Above

Answer Posted / subbu[iit kgp]

the given program as it gives errors, with some
modifications as

#define fun(a,b,t) g ##t=(a);(a)=(b);(b)=g##t
float gfloat;
main()
{
float a=1.12,b=3.14;
fun(a,b,float);
printf("a=%4.2f,b=%4.2f",a,b);
}

gives the output as option c

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is struct padding needed?

636


In a switch statement, explain what will happen if a break statement is omitted?

641


I just typed in this program, and it is acting strangely. Can you see anything wrong with it?

567


What are 'near' and 'far' pointers?

624


Write a code to determine the total number of stops an elevator would take to serve N number of people.

735






What are the types of data types and explain?

675


What is line in c preprocessor?

618


int i=3; this declaration tells the C compiler to a) reserve space in memory to hold the integer value b) associate the name i with this memory location c) store the value 3 at this location d) all the above

758


What is the acronym for ansi?

636


Where static variables are stored in c?

593


‘ C’ PROGRAME TO SHOW THE TYPE OF TRANGLE BY ACCEPTING IT’S LENGTH .

2377


What is c language and why we use it?

626


List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.

2305


What are categories used for in c?

573


How to delete a node from linked list w/o using collectons?

2092