C++ Exercises: Sum of all positive integers in a sentence
Sum Positive Integers in Text
Write a C++ program to sum all positive integers in a sentence.
Sample string: There are 12 chairs, 15 desks, 1 blackboard and 2 fans.
Output: 30
Sample Solution:
C++ Code :
Sample Output:
Input number: 12 chairs, 15 desks, 1 blackboard and 2 fans Sum of all positive integers: 30
Flowchart:

C++ Code Editor:
Previous: Write a C++ program to check whether two straight lines AB and CD are orthogonal or not.
Next: Write a C++ program to display all the leap years between two given years. If there is no leap year in the given period,display a suitable message.
What is the difficulty level of this exercise?
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics