Your task is to use for loops to display only odd natural numbers from 1 till users choice
Added by Ivan P.
Step 1
This can be done by using an input function and converting the input into an integer since the input function returns a string by default. For example, you can use `n = int(input("Enter the upper limit: "))` to get the user's input and store it in a variable `n`. Show more…
Show all steps
Your feedback will help us improve your experience
Liam Haas-Neill and 101 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 program to find whether a given number is odd or even. The program should continue as long as the user wants? use c++ program
James K.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD