Logo 
Search:

C Programming FAQ

Submit Interview FAQ
Home » Interview FAQ » C ProgrammingRSS Feeds

C programming practical question 106

  Shared By: Adah Miller    Date: Jan 24    Category: C Programming    Views: 64

Answer:

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


Answer:
10


Explanation:
The macro expands and evaluates to as:
x+2*y-1 => x+(2*y)-1 => 10

Share: 
 

Didn't find what you were looking for? Find more on C programming practical question 106 Or get search suggestion and latest updates.


Your Comment
  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].


Tagged: