Caleb and Irfan are purchasing apples which were priced according to their size.But their budget is minimum.So they plan to choose one small, one medium and one large apple so that it will fit in their budget.So can you help them choose the right apple by creating a logic by naming three apples they choose as apple1,apple2,apple3. Then check the condition if apple2 is greater than apple1 and apple3 is greater than apple2.
#include <stdio.h>
int main()
{
int apple1,apple2,apple3;
scanf("%d\n%d\n%d",&apple1,&apple2,&apple3);
if(apple2>apple1)
{ if(apple3>apple2)
{ printf("Fit into Budget");
}else printf("Dosen't fit into Budget");
}
else
{ printf("Dosen't fit into Budget");
}
return 0;
}
Comments
Post a Comment