What is error in the code?

hello @kailash_01
your logic is correct, u have done mistake in taking input
image
change r with c and c with r. in above highlighted part it will work;