simple program of c++ to understand the use array.simple program of c++ to understand the use array calculate the average temperature of 7 days using array in c++.
Average Maximum and Minimum Temperature of 7 Days using Array in C++
#include<iostream> #include<conio.h> using namespace std; main() { float temp[7],sum=0; int i=0; while(i<=6) { cout<<"Enter the temp. of day"<<i+1<<"?"<<endl; cin>>temp[i]; sum=sum+temp[i]; i++; } cout<<"\nAverage temperature :"<<sum/7.0; getch(); }