To take input string in c, we can opt for 2 ways(as per my knowledge please add more if i missing something)
char name[10];
scanf(" %s",name); // First case
scanf("%[\n]s",name); // Second case
1st one will consider the string till the first blank space and 2nd will take complete sentence till the new line break as a string but to take input we need to improvise the 2nd statement as
scanf(" %[\n]s",name);
my question is what is extra spacing doing here ? because sometime my compiler will behave normally even if i will remove the 's' from scanf statement and without extra spacing before '%' but sometime it wont work.