Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int array[5]={5,7,15,23,45},maximum, size,c, location = 1;
- for (c = 0; c <5; c++)
- maximum = array[0];
- for (c = 1; c <5; c++)
- {
- if (array[c] > maximum)
- {
- maximum = array[c];
- location = c+1;
- }
- }
- printf("Highest_value: %d\n",maximum);
- printf("position: %d\n",location);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement