Please look into the code how to print the required output

how to print the required output

hi @itzzeeshu5 refer
https://ide.codingblocks.com/s/667728