Question
You enjoy collecting marbles and keep them all in a jar. In this jar you have a variety of colors and for each color present in your jar you have the same amount of marbles. For example, if you have 40 marbles in the jar and four different colors (blue, red, green, white), then you will have 10 of each. Given that you'd rather not count ALL of the marbles in your jar you remove at least one of each color and ALL of the marbles of at least one color and from this you will calculate the total number of marbles in the jar.
Explanation / Answer
#include #include main() { int c, n, N; printf("please enter the number of colors available in the jar:"); scanf("%d", c); printf(" please enter the number of marbles of a single color in the jar:"); scanf("%d", n); N = c*n; printf( " the total number of marbles present in the jar = %d", N); }