A cura di: Nicola Vitale
int main(void) { int counter, number, largest; counter = 1; /* richiedi primo numero e salvalo in largest */ printf("Enter %dst number: ", counter); scanf("%d", &largest); counter = counter + 1; while (counter <= 10) { printf("Enter %dst number: ", counter); scanf("%d", &number); if (number > largest) largest = number; counter = counter + 1; } printf("The largest is %dn", largest); return (0); }
- Programmazione