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

Popular posts from this blog

Elavenil has a chessboard with N rows and M columns. In one step, he can choose two cells of the chessboard which share a common edge (that has not been cut yet) and cut this edge. Formally, the chessboard is split into two or more pieces if it is possible to partition its cells into two non-empty subsets S1 and S2 (S1∩S2=∅, |S1|+|S2|=NM) such that there is no pair of cells c1,c2 (c1∈S1,c2∈S2) which share a common edge that has not been cut.Elavenil does not want the board to split into two or more pieces. Compute the maximum number of steps he can perform while satisfying this condition.

The Matriculation school have arranged an Annual Day Function.Volunteers have decorated a floor on various places of the school using Rose and Tulip flowers. But one of the coordinators requested the volunteers to rearrange the decoration like a triangular size.Coordinator also told them that tulips flowers need to be positioned at the middle of the roses

Mukesh and Salima was looking to buy Organic Apples in the nearest fruits shop.But Shop Owner mixed the Hybrid apples in that Apple box. After sometimes Mukesh checking the box, he was confused among organic and hybrid apple. He started to count the hybrid apples. Please help to Mukesh Count the total number of hybrid apples in the box.