#include <stdio.h> void main() { int num, a, max; printf("Enter First Number: "); scanf("%d", &num); max = num; for (a = 1; a <= 9; a++) { printf("Enter Next Number: "); scanf("%d", &num); if (max < num) { max = num; } } printf("Largest = %d", max);}
1 2 3 4 5 6 7 9 2 4
Enter First Number: Enter Next Number: Enter Next Number: Enter Next Number: Enter Next Number: Enter Next Number: Enter Next Number: Enter Next Number: Enter Next Number: Enter Next Number: Largest = 9
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!