Logo 
Search:

C Programming FAQ

Submit Interview FAQ
Home » Interview FAQ » C ProgrammingRSS Feeds

C programming practical question 21

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

Answer:

#define square(x) x*x
main()
{
int i;
i = 64/square(4);
printf("%d",i);
}


Answer:
64


Explanation:
the macro call square(4) will substituted by 4*4 so the expression becomes i = 64/4*4 . Since / and * has equal priority the expression will be evaluated as (64/4)*4 i.e. 16*4 = 64

Share: 
 

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


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


Tagged: