Portfolio Title





 

 

Student Portfolio >> Index >> Coding >> Exercise 10

#include <iostream.h>           
int main() 
             { int rainfall[12];
   int month, amount;
   float total = 0, average; 
   for (month =0; month < 12; month++)
   rainfall[month]=0;
   for(month =0; month <12;month++)
   { cout <<"\n enter rain for month:"<<month + 1;
   cin >>amount; 
   rainfall[month]=amount;
   total=total + amount;
   }
   average =total/12;
   cout << "\n Average rainfall = "<<average<<endl;
   }


<< Back                                                                                                                                                                                       Forward >>

Coding | Website Scripting | Visual Design | Instructional Design | Website Design | Website Design Tools

 

Copyright 2005 Kerstin Kegel