#include <iostream.h>
#include <conio.h>
using namespace std;
int main()
{
int arry[5], j=0 ,sec_large , m=0 , arryy[4] , largest , k;
cout<<" Enter the 5 Integers :: \n";
for( int x=0 ; x< 5 ; x ++ )
{
cin>>arry[x];
largest = arry[0] ;
if(arry[x]>largest)
largest=arry[x];
j=largest;
}
for( int d =0 ; d < 5 ; d++ )
{
if(j!= arry[d])
{arryy[m]= arry[d] ;
m++;}
else
{
arryy[0]=0 ;
}
}
k=arryy[0] ;
for(int f=0 ; f< m ; f++)
{
if(k<arryy[f])
k=arryy[f];
}
cout<<" \n\n\n 1st largest "<< k <<"\n\n\n";
cout<<" \n\n\n 2nt largest "<< largest <<"\n\n\n";
}
- Blogger Comment
- Facebook Comment
Subscribe to:
Post Comments
(
Atom
)
0 comments:
Post a Comment