It’s correct,I too received the same output.
Yes, the program is correct and the output is same as i got.