Q. Determine Output

Code:
#define square(x) x*x
void main()
{
      int i;
      i = 64/square(4);
      printf("%d", i);
}
  • (A) 4
  • (B) 65
  • (C) 16
  • (D) None of these
πŸ’¬ Discuss
βœ… Correct Answer: (B) 65
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
Explanation by: Rajeev Malhotra
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

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
205
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Rajeev Malhotra
Publisher
πŸ“ˆ
97%
Success Rate