About the string

i want to ask why it get first string as a null string in input buffer

Hello @manoj2597
it will treat \n (that is remain inside buffer) as string and then read the same instead of next string . thats why u will get one empty string in output.

so to remove \n from buffer we first use cin.get() and then read next string