Advertisement
M_Cracked

lista 4 ex 6

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