Three brothers want to take a photo with family members. The photographer is capturing the photo from a long distance. Some of the family members are standing behind that brothers and those people are not visible to the photographer. So the photographer gets confused with the heights of three brothers. To get clarity, he asked, "who is the tallest person among those three brothers? But no one responded clearly. Can you help the photographer in finding the tallest among the three brothers?
#include <stdio.h>
int main()
{ int bro1,bro2,bro3,tallest;
scanf("%d %d %d",&bro1,&bro2,&bro3);
if(bro1>bro2&&bro1>bro3)
{ tallest=bro1; printf("%d",tallest);}
else if (bro2>bro3)
{ tallest=bro2; printf("%d",tallest);}
else
{ printf("%d",bro3);}
return 0;
}
Comments
Post a Comment