Advertisement
Zahid_hasan

test 3..

Sep 9th, 2019
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int array[5]={5,7,15,23,45},maximum, size,c, location = 1;
  6.  
  7. for (c = 0; c <5; c++)
  8.  
  9. maximum = array[0];
  10.  
  11. for (c = 1; c <5; c++)
  12. {
  13. if (array[c] > maximum)
  14. {
  15. maximum = array[c];
  16. location = c+1;
  17. }
  18. }
  19. printf("Highest_value: %d\n",maximum);
  20. printf("position: %d\n",location);
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement