Question: bWrite a program that contains two methods: printOdds ( int n ) - accepts an integer argument in parameter n , and prints the odd

bWrite a program that contains two methods:
printOdds(int n)- accepts an integer argument in parameter n, and prints the odd numbers from 1 to n
printEvens(int n)- accepts an integer argument in parameter n, and prints the even numbers from 2 to n
Your main should prompt the user for an integer and call printOdds and printEvens (in that order). Use a for loop (in main) to do this twice.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!