Skip to content

Instantly share code, notes, and snippets.

@jhonylucas74
Created December 18, 2014 18:19
Show Gist options
  • Save jhonylucas74/2b7b21b2421d6f2bf1c0 to your computer and use it in GitHub Desktop.
Save jhonylucas74/2b7b21b2421d6f2bf1c0 to your computer and use it in GitHub Desktop.
Questão 1
#include <stdio.h>
int main(){
int x;
int y;
int vetor[12];
int i;
printf("Digite os valore do vetor.\n");
for( i = 0; i<12; i++){
scanf("%d",&vetor[i]);
}
printf("Digite a posição x \n");
scanf("%d",&x);
printf("Digite a posição y \n");
scanf("%d",&y);
printf("Soma : %d\n",(vetor[x]+vetor[y]));
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment