Try Catch and If and else problem. Need the code in c# | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
0

Try Catch and If and else problem. Need the code in c#

Add more input validation to the program by printing "You must enter a positive number." if the user enters a negative number and if user enters a decimal number program should print "You must enter a whole number". Add an if/else conditional statement just after parsing the user's provided input to an integer Write a conditional expression to ensure that the remainder of the code in the try block is only executed if the user provides a non-negative number If the user enters a negative number, output to the console the message "You must enter a positive number."

10th Sep 2018, 3:55 PM
Ankit Biswas
Ankit Biswas - avatar
1 Réponse
+ 2
You should atleast have an attempt creating that program so that anyone would help you rather than giving us a task to do the whole program.
10th Sep 2018, 5:20 PM
Email Not Activated