A string constant in C is stored as a character array, while creating such an array element by element, is it necessary to supply the null character.
I need to store
No, but you should leave out number
number
char S[]= "hello\n";
will have the trailing 0 character and the array sized as needed.
With number too small you could accidentally cut off the 0 character.