Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main (){
- int n,y,pos,i,j;
- scanf("%d",&n);
- int x[n];
- for (i=0;i<n;i++){
- scanf("%d",&x[i]);
- }
- y=x[0];
- for (j=0;j<n;j++){
- if(x[j]<y){
- y=x[j];
- pos=j;
- }
- }
- printf("Menor valor: %d\nPosicao: %d\n",y,pos);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement