#define f(g,g2) g##g2
main()
{
int var12=100;
printf("%d",f(var,12));
}
Answers were Sorted based on User's Feedback
Answer / arnab maji
Hey Susie,
The ## is a concatenation operator,
When you pass the two arguments they get concatenated as
i/p --> f(g,g2) g##g2
o/p --> gg2
hence
f(var,12) will give us var12
effectively the printf statement gets modified as
printf("%d",f(var,12)); --> printf("%d",var12);
hence the output is 100 ie the value of var12.
| Is This Answer Correct ? | 56 Yes | 3 No |
Answer / vignesh1988i
the answer is 10012, the printf statement must be :
printf("%d",f(var12,12));
the number 12 will be concatenated by 100.
thank u.
| Is This Answer Correct ? | 7 Yes | 17 No |
Write a routine to draw a circle (x ** 2 + y ** 2 = r ** 2) without making use of any floating point computations at all.
2 Answers Mentor Graphics, Microsoft,
main( ) { int a[2][3][2] = {{{2,4},{7,8},{3,4}},{{2,2},{2,3},{3,4}}}; printf(ā%u %u %u %d \nā,a,*a,**a,***a); printf(ā%u %u %u %d \nā,a+1,*a+1,**a+1,***a+1); }
void main() { int c; c=printf("Hello world"); printf("\n%d",c); }
main() { char name[10],s[12]; scanf(" \"%[^\"]\"",s); } How scanf will execute?
void main() { int i=5; printf("%d",i++ + ++i); }
What is the difference between proc means and proc tabulate ? explain with a simple example when you have to use means or tabulate?
write a c-program to display the time using FOR loop
int i=10; main() { extern int i; { int i=20; { const volatile unsigned i=30; printf("%d",i); } printf("%d",i); } printf("%d",i); }
PROG. TO PRODUCE 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1
what is variable length argument list?
what is the code of the output of print the 10 fibonacci number series
#include<stdio.h> main() { char s[]={'a','b','c','\n','c','\0'}; char *p,*str,*str1; p=&s[3]; str=p; str1=s; printf("%d",++*p + ++*str1-32); }