Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int array[100], maximum, size, c, location = 1,idx;
- int main()
- {
- scanf("%d", &size);
- for (c = 0; c < size; c++)
- scanf("%d", &array[c]);
- idx = max(array,size);
- deleteitem(array,size,idx);
- for (c = 0; c < size; c++)
- printf("%d\n", array[c]);
- return 0;
- }
- int max(int array[] , int n)
- {
- maximum = array[0];
- for (c = 1; c < n; c++)
- {
- printf(array[c]);
- if (array[c] > maximum)
- {
- maximum = array[c];
- location = c+1;
- }
- }
- return location;
- }
- int deleteitem(int array[] , int n , int index )
- {
- for (c = index - 1; c < n - 1; c++)
- array[c] = array[c+1];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement