Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 40121

C++ Exception Handling

$
0
0

Can someone help me out in C++ ?

suppose i want to check whether an input number ( by user ) is even or not.. then i ask user to input a number ( only digit numbers )..and then i can simply check.

But Now , I want to handle all non digit input..so if user inputs any non digit value , then i want to throw an exception and want to handle that exception properly with the message "Enter the number again : " and repeat this process untill user inputs a digit value ( so that i could check even or odd ).

Please help me with the proper solution..I have spent my 2+ hours in this , but i m not able to get the correct solution.

*Any help would be appreciated..


Viewing all articles
Browse latest Browse all 40121

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>