saving . . . saved Assignment query has been deleted. Assignment query has been hidden .
Assignment query
Title
Question
For assignment 1 (for even) it is ok or not
{
int n =22;
if(n%2==0)
n%11==0;
else 
System.out.println("it is not even or multiple of 11");

Java Nested-if 08-09 min 30-40 sec 18-04-20, 8:18 p.m. Jp_2410

Answers:

What is the question?
20-04-20, 3:56 p.m. kannan
Check the whether the given no. is even and multiple with 11.
Using Nested if 
22-04-20, 8:34 p.m. Jp_2410

Login to add comment


So, what is your question?  There is no need submit the assignment.
22-04-20, 10:39 p.m. kannan
I only insist that you would check this code is right or not 
22-04-20, 10:53 p.m. Jp_2410

Login to add comment


Problem: To check whether given number is even and also multiple of 11.

Hint for Solution: 
Step 1: Check divisibility of the number by 2, using if statement. 
Step 2:  Inside if block of step 1,  write another if statement to check divisibility by 11. Writing if block in another if block will check divisibility by 2 and 11 both.
Step 3: Inside if block of step 2, write print statement saying the number is even and also divisible by 11.
Step 4: In the corresponding else blocks of both if statements, write print statement saying the number is not even and also divisible by 11. 
22-05-20, 2:52 p.m. pankajap@cse.iitb.ac.in


Log-in to answer to this question.