Advertisement
PROFESSOR_AIH

Highest and Position

Mar 30th, 2022
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.34 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     int i,arr[100],temp,pos;
  5.     for(i=0; i<100; i++)
  6.     {
  7.         scanf("%d",&arr[i]);
  8.     }
  9.     temp=arr[0];
  10.     pos=0;
  11.     for(i=1; i<100; i++)
  12.     {
  13.         if(arr[i]>temp)
  14.         {
  15.             temp=arr[i];
  16.             pos=i;
  17.         }
  18.     }
  19.     printf("%d\n%d\n",temp,(pos+1));
  20.     return 0;
  21. }
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement