Write a program read an integer


Discussion:

Q: Write a program that read in an integer. If the integer is a negative number, catch the exception and print an error message "Invalid Integer: value negative" and prompt the user for another number. If the integer is zero, catch the exception and print a message, "Integer cannot be zero, and end the program. Otherwise, just print the value of the integer.

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Write a program read an integer
Reference No:- TGS01937525

Now Priced at $20 (50% Discount)

Recommended (93%)

Rated (4.5/5)