WAP TO FIND THE MAX. ELEMENT IN AN ARRAY

 

#include<iostream.h>
#include<conio.h>
Void main()
{
    int lar[15],i,max=0;
    clrscr();
    for(i=0;i<5;i++)
    {
         cout<<”Enter ”<<i+1<<” element:”;
         cin>>lar[i];
    }
    max=lar[0];
    for(i=1;i<5;i++)
    {
         If(max<lar[i])
             max=lar[i];
     }
      Cout<<”Largest element is:”;
      getch();
  }
     


Comments

Popular Posts