John has n sweets which are to be distributed equally to m kids. Design the flowchart such that it also prints number of sweets each kid gets and the remaining sweets with John
Answers
Explanation:
There are many languages in which the program or the flowchart can be written. The below program is written in C language, a commonly used language
Program
void main () :
bool done = false
int n; // n is the number of sweets
int m; //m is the number of kids
int s
int r
s = n / m
r = n % m
print( "Number of sweets per kid is %i" ,s )
print( "Number of sweets left with John is %i" ,r )
return
Answer:
Explanation:
There are many languages in which the program or the flowchart can be written. The below program is written in C language, a commonly used language
Program
void main () :
bool done = false
int n; // n is the number of sweets
int m; //m is the number of kids
int s
int r
s = n / m
r = n % m
print( "Number of sweets per kid is %i" ,s )
print( "Number of sweets left with John is %i" ,r )
return