Skip to content

Instantly share code, notes, and snippets.

@colltoaction
Created July 30, 2012 15:40
Show Gist options
  • Save colltoaction/3207904 to your computer and use it in GitHub Desktop.
Save colltoaction/3207904 to your computer and use it in GitHub Desktop.
Problemas con C
// *** funciona ***
#include <stdio.h>
#define MAX 2
int main(){
int vector[MAX];
for (int i=0; i<=MAX; i++){
int a;
printf("Ingrese un numero:");
scanf("%i", &a);
printf("i es %i", i);
}
return 1;
}
// *** no funciona ***
#include <stdio.h>
#define MAX 2
int main(){
int vector[MAX];
for (int i=0; i<=MAX; i++){
int a;
printf("Ingrese un numero:");
scanf("%i", &a);
vector[i] = a;
printf("i es %i", i);
}
return 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment