How do the puts and gets functions work?
The problem here is, for an input like abc XYZ the code scanf(“%s”,name); reads only the “abc” part and the “XYZ” is left in the input buffer. The later gets() read that, and puts() prints that. As you don’t have a newline after the printf(), the output is not flushed and the outcome of the … Read more