0% found this document useful (0 votes)
17 views7 pages

Average Rainfall Value// // Sagar Posugade// // ROLL NO: 40

This C program calculates the average rainfall over a 7 year period. It prompts the user to input the rainfall value for each of the 7 years, sums all the values, and divides the total by 7 to determine the average rainfall. The output displays the calculated average of 14 inches of rainfall.

Uploaded by

structure123
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views7 pages

Average Rainfall Value// // Sagar Posugade// // ROLL NO: 40

This C program calculates the average rainfall over a 7 year period. It prompts the user to input the rainfall value for each of the 7 years, sums all the values, and divides the total by 7 to determine the average rainfall. The output displays the calculated average of 14 inches of rainfall.

Uploaded by

structure123
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

// AVERAGE RAINFALL VALUE// // Sagar posugade// // ROLL NO: 40 //

#include<stdio.h> #include<conio.h> void main() { float rain[7],avg,y=0; int i; clrscr(); for(i=0;i<7;i++) { printf("\nenter rainfall value in %d th year=",i+1); scanf("%f",&rain[i]); } for(i=0;i<7;i++) { y=y+rain[i]; } avg=y/7; printf("\nthe average rainfall value is=%f",avg); getch(); }

/* OUTPUT

enter rainfall value in 1 th year=11

enter rainfall value in 2 th year=12

enter rainfall value in 3 th year=13

enter rainfall value in 4 th year=14

enter rainfall value in 5 th year=15

enter rainfall value in 6 th year=16

enter rainfall value in 7 th year=17

the average rainfall value is=14.000000

*/

You might also like