#include(iostream.h) // place this '<' & '>' instead of '(' & ')' before iostream.h
#include(conio.h)
void main(void)
{
int a[50], max, min, i, n;
clrscr( );
cout<<"Enter how many integers do u want? :"; cin>>n;
for( i=0; i< n ; i++)
{
cout<<"Enter the numbers: ";
cin>>a[ i ];
if(i==o) { max=a[i ]; min=a[i ]; }
if(a[ i]>max)
max= a[i ];
if(a[i ]< min)
min= a[i ];
}
cout<<"Maximum : "<< max;
cout<<"Minimum : "<< min;
getch( );
}
Note:- If u have any doubt regarding this program or logic, please feel free to contact me.
Thursday, February 26, 2009
Subscribe to:
Post Comments (Atom)
wrong code
ReplyDeletecan udo it without arrays
ReplyDeleteThis comment has been removed by the author.
Deleteis it possible
ReplyDeletecan you do it without array?
ReplyDeletedo it with simple for loop without arays
ReplyDeletecan u do it with while loop
ReplyDeletePls put output also
ReplyDelete