Why cin.get() is also wrong for this code as cin.getline()?

how its going to nextline there is no ā€˜\n’ charachter