You have undefined behaviour, because b is not long enough for "swapnil"+"kaushal" - total 15 characters, but b is only 10 chars long.

So anything could happen, and the solution to the problem is to extend b to at least 15 characters so that it can cope with what you want to do. Or use strings so you can do b+=c without worrying about buffer sizes.

This is a buffer overflow bug.