FILE STOPPED WORKING!!

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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#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
Last edited on
Is this right?
 
scanf("i%",n);


And how about this?
 
for (i=0;i=n;i++)

scanf("i%",n);
Wrong syntax. Should be %i. Because of this, you never set n, so n has some random value.

for (i=0;i=n;i++)
Very suspicious syntax. Did you mean
for (i=0;i==n;i++) ?
Similarly in other for loop.

thanx, on my laptop it worked but its batts are dead so i needed on this comp
tnx again
Topic archived. No new replies allowed.