Is it correct?if not then what to type?

It’s correct,I too received the same output.

Yes, the program is correct and the output is same as i got.