QUIZ 35

What will be the output?

#include<stdio.h>
int &max(int&x,int&y)
{
if(x>y)
return(x);
else
return(y);
}

void main()
{
int a=10,b=13;
max(a,b)=-1;
printf(“a=%d, b=%dn”,a,b);
max(a,b)=7;
printf(“a=%d, b=%dn”,a++,b–);
max(a,b)=3;
printf(“a=%d, b=%dn”,a,b);
}

a. a=10, b=-1
a=10, b=7
a=10, b=-1
b. a=10, b=-1
a=7, b=-1
a=3, b=-2
c. a=10, b=-1
a=8, b=-2
a=3, b=-2
d. Error
Answer : (b)

Leave a Reply

Your email address will not be published. Required fields are marked *