Q:

What is the difference between making an array with {} and assigning values one by one in c

i am new to c and i am trying to sort an array values in a ascending order and i noticed a difference in my program when i do :
int t[5] = {5 , 4 , 3 , 2 , 1 };

and when i do :
int t[5];

t[0] = 5;
t[1] = 4;
t[2] = 3;
t[3] = 2;
t[4] = 1;

what is the difference ?
EDIT:
THE DIFFERENCE :
first program :
int t[5] = {5,4,3,2,1} ;

int i,aux;

for(i=0;i<5;i++)
    if(t[i] > t[i+1])
        aux=t[i];
        t[i]=t[i+1];
        t[i+1]=aux;

for(i=0;i<5;i++)
    printf("Val : %d\n" ,t[i] );

the output of the first program :
Val : 5
Val : 4
Val : 3
Val : 2
Val : 1

the second program :
int t[5] ;
t[0] = 5;
t[1] = 4;
t[2] = 3;
t[3] = 4;
t[4] = 5;
int i,aux;

for(i=0;i<5;i++)
    if(t[i] > t[i+1])
        aux=t[i];
        t[i]=t[i+1];
        t[i+1]=aux;

for(i=0;i<5;i++)
    printf("Val : %d\n" ,t[i] );

the second program output :
Val : 5
Val : 4
Val : 3
Val : 4
Val : 5

A:

for(i=0;i<5;i++)
    if(t[i] > t[i+1])
        aux=t[i];
        t[i]=t[i+1];
        t[i+1]=aux;

First: indentation does not reflect code structure. The for and if only affect 1 other statement
Your program is equivalent to
for (i = 0; i < 5; i++) {
    if (t[i] > t[i+1]) {
        aux = t[i];
    }
}
t[i] = t[i + 1];
t[i + 1] = aux;

Second: you are trying to access t[5] which does not exist, causing Undefined Behaviour.

