Write JavaScript code that creates an array named odds and stores all odd numbers between -6 and 38 into it. Use a for loop to fill the array.
Added by Jose Ignacio M.
Close
Step 1
First, we need to create an empty array named "odds": ```javascript var odds = []; ``` Show more…
Show all steps
Your feedback will help us improve your experience
Chandra Jain and 82 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 that will read 15 integers from the user into array num. Your program should count the number of even integers and odd integers and print it on the screen. Sample Output: Enter 15 integers: 3 4 5 6 7 8 10 11 12 13 14 15 Number of odds: Number of evens:
Shelayah R.
Write a program that will ask a user for how many numbers they would like to check. Then, using a for loop, prompt the user for a number and output if that number is even or odd. Continue doing this as many times as the user indicated. Once the loop ends, output how many even numbers were entered and how many odd numbers were entered.
Liam H.
Write a program in Python to calculate and display the sum of all odd numbers in the list
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