I made a code in CodeBlocks that seems perfectly fine, but when I compile it the following (in the images in the link) happens: http://postimg.org/gallery/imbtu6ns/ Here is the code:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(){
int x,num[x],n,small,big;
printf("Type how many numbers you will use: ");
scanf("%d",&n);
for (x=0;x<n;x++){
printf("Type a number: ");
scanf("%d",&num[x]);
}
big=num[0];
small=num[0];
for (x=0;x<n;x++){
if (num[x]<small){
menor=num[x];
}
if (num[x]>big){
maior=num[x];
}
}
printf("Maior: %d\n",big);
printf("Menor: %d\n",small);
system("pause");
return 0;
}
Its a code to read n numbers from the user and then print the smaller and the bigger number. I think there is no problem in the code. What is this error? I tryed doing whats is written here: Windows popup: X.exe has stopped working (Code::Blocks), but it didnt work.