Question: write a programm in C language and a short explain on how the codo works Problem 2 - The number of eggs A farmer has
write a programm in C language and a short explain on how the codo worksProblem 2 - The number of eggs A farmer has a chicken farm. The chickens give several eggs everyday. He keeps some of the eggs for home use (k) and he sells the rest to a shop. If the number of eggs that he has collected on that day is less than the number of eggs for home use (k), he keeps all the eggs for that day. If the number of the eggs is more than k, he keeps k eggs for home use and sells the rest. Write a program that is going to calculate the number of eggs sold to the shop. Input specification The first line contains three numbers, the number of days (n), the numbers eggs (k) kept for home use, and the number of chickens in the farm (m) where 2 sas 10000: OSK 3100 and 0m 1000. The following line contains n space separated numbers where each of the numbers is between 0 and m. Output specification Show the number of eggs sold to the shop at the end of n days. Sample input: Sample Output: 5237569 739 17
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
