Write a program that will
- Ask the user to enter lower limit and
upper limit in the form of integer numbers.
- The program will then add
/ sum all those numbers between upper limit and lower limit (including
the lower and upper limits) which are NOT multiple of 4.
- This process should continue for all
the remaining integer numbers up until the upper limit is reached.
- The program will then show the
aggregate sum of all numbers for the given range.
Make sure that lower limit
entered by the user should be greater than zero. Also the upper limit value
entered by the user should be greater than the lower limit value.
Example:
Lower limit is 1 and Upper
limit is 8 then the program will subtract 4 and 8 as these are the multiples of
4. While add remaining integers in the range (1+2+3-4+5+6+7-8 = 12). So, 12 is
the calculated number.Sample output for correct input:
cs201 assignment output |
ConversionConversion EmoticonEmoticon