Advertisement
ThaisAlmeida

vetores questão desafio

Jun 17th, 2014
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.29 KB | None | 0 0
  1. int main
  2. {
  3.     int vetor[20],i,menorvalor=0,maiorvalor=0;
  4.     i=0;
  5.     for(i=0;i<20;i++)
  6.     {
  7.         printf("Digite um valor para o vetor");
  8.         scanf("%d", &vetor[i]);
  9.         if(vetor[i]>maiorvalor)
  10.         {
  11.          maiorvalor=vetor[i];
  12.         }
  13.         if(vetor[i]<menorvalor)
  14.         {
  15.             menorvalor=vetor[i];
  16.         }
  17.         i=i++
  18.     }
  19.    
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement