The problem with scanf function is it doesnot recognises space in Name. Exmple if you entered string as “Coding street” it will store only coding in string variable so it is recommended by us to use gets over string input. Because it recognizes space and takes space also as input.
/*using gets we can take space also as input in string*/
printf("n Enter a String :");
printf("n Entered string is : %s ",svar);