Showing posts with label Macro. Show all posts
Predict the Output

Predict the Output

#define tech(a,b) a##b##a int main() { if(printf("%d",tech(4,0))) { } return 0; } Output: 404 Read about Macro
Read More
70

70

#define les(a,b)     a<b?a:b int main() { int i=1,j=3,k; k=les(i++,++j); printf ("%d %d %d",i,j,k); return 0; } Output: 3...
Read More
61

61

Predict the output: int main() { struct shark { int b; #define selva() b }s; s.selva() =4; printf ("%d",s.b); return 0; }...
Read More
58

58

#define ft(a,b) (a)*b int main () { printf ( "%d" , ft(2+1,3+1 ); return 0; } Output: 10 Logic: function is replaced with const...
Read More
56

56

In the following program which one will run without any errors?: #define a 2 int main() { int b=2; switch(b) { case a: printf("%d"...
Read More
50

50

#ifdef NULL #define NULL 2 #endif #ifndef NULL #define NULL 4 #end if int main() { printf("%d",++NULL^NULL|0); return 0; } Output:...
Read More