by Dinesh Thakur Category: Array Pointer and Union

 

 #include <iostream.h>

 #include <conio.h>
 const int size = 7;
 void main(void)
{
              float temp[size],max;
              clrscr();
              cout<< "enter the temperatures on days in a week"<<'\n';
              for(int i=0;i<size; i++)
              {
                      cin>>temp[i];
                      cout<<"Temperature on day : "<< i+1<<" : "<<temp[i]<<'\n';
              }
                      max=temp[0];
                      for(i=0; i<size; i++)
                          {
                              if (temp [i]>max)
                                  max= temp[i];
                          }
                                  cout<<"The maximum temperature in the week is " << max;
                                  cout<<"\n" ;
                                  getch();
}

the size of an array



About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.



Related Articles