Code is not giving correct output

my output is not correct