Advertisement
Divyansh_Chourey

comparison to infinity

Mar 11th, 2024
504
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.31 KB | Source Code | 0 0
  1. #include<stdio.h>
  2. int main(){
  3.     int i=0, large=-1, num, times;
  4.     printf("How many numbers you want to compare? ");
  5.     scanf("%d", &times);
  6.     while(i<=times){
  7.         printf("Enter the number: ");
  8.         scanf("%d", &num);
  9.         large=num>large?num:large;
  10.         i++;
  11.     }
  12.     printf("\n The largest number is: %d", large);
  13.     return 0;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement