Unable to get the correct output even though the code is correct

4 posts were merged into an existing topic: Am not getting the desired output