newbie needs help on small program
I am teaching myself and need to create a program:
that will read in five positive integers (one at a time) and print out the largest and smallest number of the 5 numbers. The program should read the numbers 1 at a time.
Also I need this program such that it takes an unlimited amount of positive integers.
Here is a starting attempt which may be all wrong:
Code:
#include<stdio.h>
int main() {
char number[5];
for( ; ; ; ) {
printf("%5d\n", number++);
}
return 0;
}
I would really appreciate any input or solution!
Dodgetech