Advertisement
Mary_99

Max number in tab

Nov 25th, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.42 KB | None | 0 0
  1. include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     int i;
  6.     float max, tab[10];
  7.     printf("program calcualting the maximum numer\n");
  8.     for (i = 0; i < 10; i++)
  9.     {
  10.         printf(" enter number %d :\n", i+1);
  11.         scanf("%f", &tab[i]);
  12.     }
  13.     max = tab[0];
  14.     for (i = 0; i < 10; i++)
  15.         if(tab[i]>max) max = tab[i];
  16.         printf(" The maximum number equals %10.5f\n", max);
  17.     getchar();
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement