Write a C++ program that should continuously ask the user to input any integer number until and unless a negative number is entered. When a negative number is entered, then the program should end and print the sum of all the entered numbers.
However, it should also check that large numbers (greater than 30) should not be considered for calculating the sum, like shown below:
cpp programming exercise with solution |