Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Write a C++ program that takes ten whole numbers as input , and that outputs the sum of all the numbers greater than zero ,

Write a C++ program that takes ten whole numbers as input, and that outputs the sum of all the numbers greater than

zero, the sum of all the numbers less than zero, and the sum of all the numbers, whether positive, negative, or zero.

Requirements:

  • The user enters the ten numbers just once each and the user can enter them in any order.
    • For example:
      • Input 10 Whole Numbers : 1 5 2 6 7 10 7 3 4 8
  • Your program should not ask the user to enter the positive numbers and the negative numbers separately.
  • Use appropriate data type for each variable.
  • State your name in a comment line.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions