Ramesh is working in an engineering college hostel as a Mess supervisor. There are different messes are available based on the years. Every day students count is varying in all the hostels due to continuous holidays.Since ramesh is in charge of the cooking team. He had trouble with calculating the quantity of food that needs to be prepared because of the varying student count.Even if a small quantity of food is prepared by the cooking team, it should be divided equally among the number of Mess.Ramesh needs an automated software to identify the amount of food available (in number of packets ) and Mess count. Can you help him to divide the food equally and also calculating the remaining quantity of food that will be available after sharing the food equally ?

 #include <stdio.h>

int main()

{

    int alvqntoffood,messcnt,dividedqnt,remfood;

    scanf("%d",&alvqntoffood);

    scanf("%d",&messcnt);

    dividedqnt=alvqntoffood/messcnt;

    remfood=alvqntoffood%messcnt;

    printf("%d",dividedqnt);

    printf(" ");

    printf("%d",remfood);

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.

Akash the die heart fan of AR Rahman went to the live concert happened in Bangalore with his family members.The event management firm responsible for the event arranged the seats for the audience in descending order of maximum number of tickets booked for single family.

Mahesh has given a two-dimensional 3*3 array starting from A [0][0]. You should add the alternate elements of the array and print its sum. It should print two different numbers the first being sum of A 0 0, A 0 2, A 1 1, A 2 0, A 2 2 and A 0 1, A 1 0, A 1 2, A 2 1.