#define prod(a,b) a*b

main()

{

int x=3,y=4;

printf("%d",prod(x+2,y-1));

}



#define prod(a,b) a*b main() { int x=3,y=4; printf("%d",prod(x+2,y-1)); ..

Answer / susie

Answer :

10

Explanation:

The macro expands and evaluates to as:

x+2*y-1 => x+(2*y)-1 => 10

Is This Answer Correct ?    50 Yes 2 No

Post New Answer

More C Code Interview Questions

write a c program to input initial & final time in the format hh:mm and find the time intervel between them? Ex inputs are initial 06:30 final 00:05 and 23:22 final 22.30

0 Answers  


#include<stdio.h> main() { struct xx { int x; struct yy { char s; struct xx *p; }; struct yy *q; }; }

2 Answers  


There were 10 records stored in “somefile.dat” but the following program printed 11 names. What went wrong? void main() { struct student { char name[30], rollno[6]; }stud; FILE *fp = fopen(“somefile.dat”,”r”); while(!feof(fp)) { fread(&stud, sizeof(stud), 1 , fp); puts(stud.name); } }

1 Answers  


main() { extern int i; { int i=20; { const volatile unsigned i=30; printf("%d",i); } printf("%d",i); } printf("%d",i); } int i;

1 Answers  


void main() { unsigned giveit=-1; int gotit; printf("%u ",++giveit); printf("%u \n",gotit=--giveit); }

1 Answers  






1. const char *a; 2. char* const a; 3. char const *a; -Differentiate the above declarations.

3 Answers  


Sir... please give some important coding questions asked by product companies..

0 Answers  


enum colors {BLACK,BLUE,GREEN} main() { printf("%d..%d..%d",BLACK,BLUE,GREEN); return(1); }

2 Answers  


Write a program to receive an integer and find it's octal equivalent. How can i do with using while loop.

2 Answers  


How we print the table of 2 using for loop in c programing?

14 Answers   HCL, Wipro,


#define FALSE -1 #define TRUE 1 #define NULL 0 main() { if(NULL) puts("NULL"); else if(FALSE) puts("TRUE"); else puts("FALSE"); }

1 Answers  


Give a very good method to count the number of ones in a 32 bit number. (caution: looping through testing each bit is not a solution)

7 Answers   Microsoft,


Categories