'Read input 5 integer variables from user in C++ and print the sum of only those numbers which are odd. Example: For input 10, 8, 9, 1, 6 the output should be 9+1 =10. Note- Do it without use of data structures like array:'
Added by Cesar S.
Step 1
First, we need to declare 5 integer variables to store the user input. Show more…
Show all steps
Your feedback will help us improve your experience
Anecia Mcmurrin-Bala and 54 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Write a C++ program to count the sum of integers which are divisible by 3 or 5. You should prompt the user to insert an integer which indicates the range of numbers from 1.
John B.
Write C++ statements to accomplish each of the following: 7. Declare variables sum and X to be of type int. 8. Set variable X to 0. 9. Set variable sum to 0. 10. Add variable X to variable sum and assign the result to variable sum. 11. Print "The sum is: " followed by the value of variable sum.
Florencia C.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD