Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...

#define f(g,g2) g##g2

main()

{

int var12=100;

printf("%d",f(var,12));

}

Answers were Sorted based on User's Feedback

#define f(g,g2) g##g2 main() { int var12=100; printf("%d&qu..

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 ? 55 Yes 3 No

#define f(g,g2) g##g2 main() { int var12=100; printf("%d&qu..

100

 Is This Answer Correct ? 39 Yes 2 No

#define f(g,g2) g##g2 main() { int var12=100; printf("%d&qu..

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

More C Code Interview Questions

could you please send the program code for multiplying sparse matrix in c????

main() { signed int bit=512, mBit; { mBit = ~bit; bit = bit & ~bit ; printf("%d %d", bit, mBit); } } a. 0, 0 b. 0, 513 c. 512, 0 d. 0, -513

#include<stdio.h> main() { register i=5; char j[]= "hello"; printf("%s %d",j,i); }

main() { int a=2,*f1,*f2; f1=f2=&a; *f2+=*f2+=a+=2.5; printf("\n%d %d %d",a,*f1,*f2); }

how to print 1 2 3 4 5 6 7 8 9 10 9 8 7 6 5 4 3 2 1 using any loop(for or while) only once(only 1 loop) and maximum 2 variables using C.

main() { char *a = "Hello "; char *b = "World"; clrscr(); printf("%s", strcpy(a,b)); } a. “Hello” b. “Hello World” c. “HelloWorld” d. None of the above

main() { int c[ ]={2.8,3.4,4,6.7,5}; int j,*p=c,*q=c; for(j=0;j<5;j++) { printf(" %d ",*c); ++q; } for(j=0;j<5;j++){ printf(" %d ",*p); ++p; } }

#include<stdio.h> main() { const int i=4; float j; j = ++i; printf("%d %f", i,++j); }

main() { int i=5,j=10; i=i&=j&&10; printf("%d %d",i,j); }

write a program to Insert in a sorted list

void main() { printf(“sizeof (void *) = %d \n“, sizeof( void *)); printf(“sizeof (int *) = %d \n”, sizeof(int *)); printf(“sizeof (double *) = %d \n”, sizeof(double *)); printf(“sizeof(struct unknown *) = %d \n”, sizeof(struct unknown *)); }

what is variable length argument list?

Categories