#include<iostream>
using namespace std;
main()
{ int array[10],max,min;
cout<<"Enter Array Elements";
for(int a=0;a<10;a++)
cin>>array[a];
max=min=array[0];
for(int a=0;a<10;a++)
{
if(array[a]>max)
{ max=array[a];
}
if(array[a]<min)
min=array[a];
}
cout<<"the greater number is:"<<max<<endl;
cout<<"the minimum number is:"<<min;
}
No comments:
Post a Comment