Answered step by step
Verified Expert Solution
Question
1 Approved Answer
7. Generate 1000 random integers from 0 to 1000. Count the number of these random integers which are i) odd and less than 500, ii)
7. Generate 1000 random integers from 0 to 1000. Count the number of these random integers which are i) odd and less than 500, ii) even and less than 500, iii odd and greater or equal to 500, and iv) even and greater or equal to 500. To do this, use a nested if-else-else construction, nested in a for loop. Print your results to the screen
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started