Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro Android Graphics

Authors: Wallace Jackson

1st Edition

1430257857, 978-1430257851

More Books

Students also viewed these Programming questions