using if statement. Get a number from the user. If the number is between 0 to 100 calculate sum of all odd numbers from 1 to 100, print the sum. otherwise calculate sum of all even numbers from 100 to 200, print the sum.

Programming with Microsoft Visual Basic 2017
8th Edition
ISBN:9781337102124
Author:Diane Zak
Publisher:Diane Zak
Chapter4: The Selection Structure
Section: Chapter Questions
Problem 2MQ3
icon
Related questions
Question
100%
using Python
3
using if statement. Get a number from the user.
If the number is between 0 to 100 calculate sum of all odd numbers from 1 to 100, print the sum.
otherwise calculate sum of all even numbers from 100 to 200, print the sum.
Transcribed Image Text:3 using if statement. Get a number from the user. If the number is between 0 to 100 calculate sum of all odd numbers from 1 to 100, print the sum. otherwise calculate sum of all even numbers from 100 to 200, print the sum.
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Troubleshooting
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning