Issue while initializing character array

Pratik Bhaiya explained that while initializing single character at every location we have to initialize last character as ‘\0’ but when I run that code without using '\0’as my last character the code dosen’t showed any error.

So can you explain which is the right way & if my way is wrong then why the compiler is not showing any error to me?

hello @Shivam01

adding or not adding \0 will never show any error.
becuase \0 is just a character that compiler use to detect the ending of the string.
if u dont mention it then compiler may/ may not stop at the end and continue printing garbage character .
so if u dont use \0 then output is totaly compiler dependent some may show only string or some may show string with some garbage

okky thank you Aman for explanation