Q : Write a ‘C’ program to compute the average of every third integer lying between 1 and 200? Include appropriate documentation?
printf("\n\tAverage of every third ineger till 200 is %d",avg);
For calculate average of each third number till 200. We have to skip two numbers from current value.so variable I start with 1 and skip by 2 for sake of take each third number.
Sum is total of each third numbers from 1 to 200.
When loop stop. Variable I will have number count.
For calculate average, divide total from number count. Which is achieved through avg=sum/i