My program is showing correct output but its not fulfilling third condition .What is the error in the program ?