Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<iostream>
- using namespace std;
- int main()
- {
- int a[10];
- for(int i=0;i<10;i++)
- {
- scanf("%d",&a[i]);
- }
- int max=a[0];
- int loc=0;
- for(int i=0;i<10;i++)
- {
- if(max<a[i])
- max=a[i],loc=i+1;
- }
- if(loc==0)
- printf("item not found\n");
- else
- printf("item %d found at position %d",max,loc);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment