ExamCompetition Forum Question Papers Ask A Question Mock Test Learn & Earn Sign Up Login Menu



0 vote

What will be the output of the following program?#include<stdio.h>#define prod(a,b) a*bvoid main(){ int x=3,y=4; printf("%d", prod(x+2,y-1));}

Asked on by | Votes 0 | Views: 25 | Tags: computer science     | c programming     | c preprocessor     | Add Bounty

What will be the output of the following program?#include<stdio.h>#define prod(a,b) a*bvoid main(){ int x=3,y=4; printf("%d", prod(x+2,y-1));}

A).  15

B).  12

C).  10

D).  11

E).  None of these


Share on Facebook      Share on Whatsapp       Share on Twitter




1 answers

0 vote
Answered by on | Votes 0 |

 10



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

Join Telegram Group




Answer This Question

Name:
Email:
Answer :
Sum of (3+1)
Submit: