Our Recommendation for You Search your Query, You can find easily. for example search by book name or course name or any other which is related to your education

Followers

simple program of c++ to understand the use array


simple program of c++ to understand the use array

This is the source code for understanding the simple function of the array. Here we have to calculate the average temperature of 7 days using array in c++.
#include<iostream.h>
#include<conio.h>
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();
                }
End