SHARE
TWEET

2891 find max number

a guest Oct 16th, 2019 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<stdio.h>
  2.  
  3. int  main() {
  4.  
  5.     int i,p,q;
  6.     int max = 0;
  7.     printf("Number of input :\n");
  8.     scanf("%d",&p);
  9.  
  10.     for(i=1;i<=p;i++){
  11.     printf("Enter value %d:\n",i);
  12.     scanf("%d",&q);
  13.     if (i==0) max = q;
  14.     if ( q > max)
  15.     {
  16.         max = q;
  17.     }
  18.  }
  19.       printf ("max value = %d",max);
  20.       return 0;
  21.  }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top