#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 the function. if all the character in string B appear in string A, return true, otherwise return false.
Write a routine to implement the polymarker function
respected sir, i did my MCA in 2013 when i am going to attend to an interview i was asked about my project how will i explain my project could please help me in this and my project title is "Social Networking Site For Social Responsibility"
main() { extern int i; i=20; printf("%d",i); }
Write a routine that prints out a 2-D array in spiral order
Is it possible to type a name in command line without ant quotes?
Which version do you prefer of the following two, 1) printf(ā%sā,str); // or the more curt one 2) printf(str);
how to programme using switch statements and fuctions, a programme that will output two even numbers, two odd numbers and two prime numbers of the users chioce.
0 Answers Mbarara University of Science and Technology,
What are the files which are automatically opened when a C file is executed?
Printf can be implemented by using __________ list.
why nlogn is the lower limit of any sort algorithm?
void main() { int k=ret(sizeof(float)); printf("\n here value is %d",++k); } int ret(int ret) { ret += 2.5; return(ret); }