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
Answers were Sorted based on User's Feedback
Answer / 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 |
What is clrscr ()?
Explain union. What are its advantages?
what is difference between declaring the pointer as int and char in c language?
What is the use of printf() and scanf() functions?
How can I manipulate strings of multibyte characters?
What is the difference between volatile and const volatile?
What is external variable in c?
how to find sum of 5 digits in C?
While(1) { } when this loop get terminate is it a infinite loop?
what is the difference between postfix and prefix unary increment operators?
what is y value of the code if input x=10 y=5; if (x==10) else if(x==9) elae y=8; a.9 b.8 c.6 d.7
write a c program that prints all multiples of 3between 1 and 50.