Declaration and initialization of string

Declaration and initialization of string :

The above string can also be initialized as follows.
char name[ ]="INDIA";
The c compiler inserts the NULL (\0) character automatically at the end of the string.So initialization of NULL character is not essential.
Also,
Character array can be initialized as follows.
a) char name [6]={'S','A','N','J','A','Y'};
b) char name [7]={'S','A','N','J','A','Y'};
In case (a) the output will not be 'SANJAY' but it contains some garbage value.Arguments in this example are initialized with [6] ,Which is exactly equal to a number of character instead the braces.The NULL character must be included and hence,the argument must be [7] instead of [6] as given in statement (b).

Example :
#include<stdio.h>
#include<conio.h>
void main ( )
{
char name1[6]={'S','A','N','J','A','Y'};
printf("Name1=%s",name1);
}
OUTPUT :
SANJAY 0^u*

Explanation :
The output of the above program would be SANJAY followed by some garbage value to get the correct result the argument must be [7] instead of [6].The output can be seen as given below after changing the argument [7] in place of [6]
The output will be SANJAY
The argument value must be equal to number of character + NULL character.In case The NULL character is not taken in account ( statement (a)) the string followed by the first string (statement (b)) will be displayed.