fork download
  1. #include <stdio.h>
  2.  
  3. void main() {
  4. int num, a, max;
  5. printf("Enter First Number: ");
  6. scanf("%d", &num);
  7. max = num;
  8. for (a = 1; a <= 9; a++) {
  9. printf("Enter Next Number: ");
  10. scanf("%d", &num);
  11. if (max < num) {
  12. max = num;
  13. }
  14. }
  15. printf("Largest = %d", max);
  16. }
Success #stdin #stdout 0.01s 5280KB
stdin
1 2 3 4 5 6 7 9 2 4
stdout
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