i input 10 integers and the program will find it's higest number and lowest number. i already have the code for inputting 10 integers and finding it's highest and lowest number but i dont know how to do this with array.
how can i insert array into my code?
this is the code:
main()
{
int myI;
int hi, low;
int i;
clrscr();
for(i=1; i<=10; i++)
{
printf("Enter integer #%d:",i); scanf("%d",&myI);
if(i==1)
{
hi=myI;
low=myI;
}
if(myI>hi)
{
hi=myI;
}
if(myI
{
low=myI;
}
}
printf("The highest integer is %d\n",hi);
printf("The lowest integer is %d\n",low);
getch();
}
thnx
2007-12-12
02:05:36
·
3 answers
·
asked by
Mikaela
1
in
Computers & Internet
➔ Programming & Design