Hi guys,
I had a problem, I created a C++ file in DEV C++ 4.9.9.2 Beta and it crashed. Ok, this computer is slow so i tryed again. And it crashed AGAIN. And always. I didn't find any errors. here is the code
#include<stdio.h>
#include<stdlib.h>
int main()
{
//-----------------------------------variable spec--------------------------
int i,j,n,pom,a[100];
//-----------------------------------no of data-----------------------------
printf("n=");
scanf("i%",n);
//-----------------------------------data enter-----------------------------
for (i=0;i=n;i++)
{
printf("unesi vrednost \n");//enter value
scanf("%i",a[i]);
}
//-----------------------------------change if bigger-----------------------
for (i=0;i=n-1;i++)
{
for (j=i+1;j=n;j++)
{
if (a[i]<a[j])
{
pom=a[i];
a[i]=a[j];
a[j]=pom;
}
}
}
//-----------------------------------output---------------------------------
printf("sortirane vrednosti \n");//sorted values
for (i=0;i=n;i++)
{
printf("%i\n",a[i]);
}
system ("PAUSE");
return 0;
}
it's on serbian. OK now i compile it, run it it says
n=
I enter 4, for example and enter
n=4
unesite vrednost
and it goes blury, and it says
sort1.exe has stopped working
Windows is checking for a solution
and the loading bar under.
PLEASE help i need it till tuesday, 10th april of homework from ICT
THANKS