Computer Science, asked by aaliyaraza, 7 months ago

Suppose you have to make a program for your granny; who, due to her advanced age, is able

to do calculations, not even a simple division. She got a package which contains 90 candies,

and she wants to distribute it among her all grandchildren. She has 5 grandchildren, among

them 3 are the granddaughters. She wants to distribute candies such as a granddaughter gets

twice candies as gets by a grandson. Develop program using C language​

Answers

Answered by nehasahoo14
4

Answer:

#include<stdio.h>

int main()

{

int i,c,d,s,e,f;

printf("enter the total number of grandchildren");

scanf("%d",&c);

printf("enter the total number of granddaughter");

scanf("%d",&e);

printf("enter the total number of grandson");

scanf("%d",&f);

printf("enter the total number of items to be distributed");

scanf("%d",&i);

s=i/(2*e+f);

d=2*i/(2*e+f);

printf("granddaughter gets:%d grandson gets:%d",d,s);

scanf("%d",&c);

return 0;

}

Similar questions