somebody can help me?

Whats wrong with that?

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
  #include<stdio.h>
  #include<conio.h>
main()
{
      int a[5];
      int l = 3, b = 3;
      for(l = 3; l > 0;  l--){
            printf("enter a number:");
            scanf("%d", &a[0]);
            a[0]++;
            }
           
                  
            if (a[0] >= a[1] && a[0] >= a[2])
            printf("%d is the largest number", a[0]);
            else if (a[1] >= a[0] && a[1] >= a[2])
            printf("%d is the largest number", a[1]);
            else if (a[2] >= a[0] && a[2] >= a[1])
            printf("%d is the largest number", a[2]);
            
            
            
            getch();
            }
      
a[1]..a[4] is uninitialized change &a[0] to &a[i] at line 9
thank u!
Why are you using a[0]++; at line 10?
Topic archived. No new replies allowed.