#include<iostream.h>
#include<conio.h>
void main()
{
int a['z'],size,max,min;
cout<<"Enter size of 1-D array :\n";
cin>>size;
for(int i=0;i< size; i++)
{
cout<<"\nEnter element "<<(i+1)<<" : ";
cin>>a[i];
}
max=a[0];
min=a[0];
for(int i=0;i<size; i++)
{
if(max<a[i])
{
max=a[i];
}
if(min>a[i])
{
min=a[i];
}
}
cout<<"\nMaximum number is : "<<max;
cout<<"\nMinimum number is : "<<min;
getch();
}
It's an attempt to help all C.Sc. students (of Class 11 and 12). Search for your needs, for better search try labels (at right sidebar), and message your reviews and requests. Have a Pleasant Programming !! :)
Make Your Search Easy ! :) Use me
Friday, February 17, 2017
Take an array as input and to find maximum and minimum term in it :-
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment