Question: (Use java code) 1. Given two integers M and N from the user, print all ODD numbers that are NOT PRIMES between M and N

(Use java code)

1. Given two integers M and N from the user, print all ODD numbers that are NOT PRIMES between M and N (inclusive). Input: M=10, N=25 Output: 15 21 25 Explanation: The prime numbers between 10 and 25 are: 11, 13, 17, 19 and 23. So, we are printing all the odd numbers between 10 and 25 that are not prime.

(Use java code)

2. Write a program that takes an integer N from the user and prints the following pattern with N number of rows. Input: N=5 Output: Explanation: Since, N=5 we have to print 5 rows. Each row will contain one less column than the previous one. The value in each column will alternate between 0 and 1.

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 Programming Questions!