Write an algorithm and draw the flowchart to find the sum of odd numbers from 20 to 50.
Added by Frederick S.
Step 1
- Initialize a variable 'num' to store the current number, set its initial value to 20. Step 2: Check if the number is odd - If 'num' is odd (num % 2 != 0), add it to the 'sum' variable. Step 3: Increment the number - Increment the 'num' variable by 1. Step 4: Show more…
Show all steps
Your feedback will help us improve your experience
Akash M and 56 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 an algorithm and draw a flowchart to check if a given number is even or odd:'
Florencia C.
Find each sum as described. The sum of the first 50 positive odd integers?
Further Topics in Algebra
Arithmetic Sequences and Series
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
Watch the video solution with this free unlock.
EMAIL
PASSWORD