Every compiler crashes when i run this program

Ok, this might sound stupid but my friends challenged me to make a swastika in a matrix. Apparently every compiler i tried crashes when i run the program. I get no errors though and i also tried it on several computers
anyone knows what the problem is?
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include <iostream>

using namespace std;

int main()
{int i,j,v[i][j],n,p;

cout<<" n:";
cin>>n;
p=(n/2)+1;

for(i=1;i<=n;i++)
    {for(j=1;j<=n;j++)
    cout<<"v"<<i<<j<<"=";
cin>>v[i][j];}


for(j=1;j<=n;j++)
{
    if(j>=1 && j<=p)
        cout<<v[1][j];
    if(j>p && j<n)
        cout<<" ";
    if(j==n)
        cout<<v[1][j];
}
cout<<endl;

for(i=2;i<=p-1;i++)
{
    for(j=1;j<=n;j++)
    {
        if(j>=1 && j<p)
            cout<<" ";
        if(j==p)
            cout<<v[i][j];
        if(j>p && j<n)
            cout<<" ";

    }
    cout<<endl;
}

for(j=1;j<=n;j++)
    cout<<v[p][j];
cout<<endl;

for(i=p+1;i<=n-1;i++)
{
    for(j=1;j<=n;j++)
    {
        if(j==1 || j==p)
            cout<<v[i][j];
        if(j>1 && j<p)
            cout<<" ";
        if(j>p)
            cout<<" ";
    }
    cout<<endl;
}


for(j=1;j<=n;j++)
{
    if(j==1)
        cout<<v[n][j];
    if(j>1 && j<p)
        cout<<" ";
    if(j>=p)
        cout<<v[n][j];
}
    return 0;
}
{int i,j,v[i][j],n,p; you need to give i and j a value
Apparently every compiler i tried crashes when i run the program.

A compiler converts source code into a binary program. There is no compiler involved, when a program is run.

Which compilers did you use? GCC, Clang, Intel, Cray, MS? Which warning options did your compilers have set? Compilers rarely crash. They can stop on syntax error, but they do tell the error. They might warn about potentially dangerous (but legal) constructs. To actually crash a compiler does require some effort.
Topic archived. No new replies allowed.