# Judgment of odd and even numbers

After writing the conclusion, I should have used "%" in the conditional expression of if.

When I do four arithmetic operations, I always use "remainder" I thought, but I see, I used it.

Divide by 2 and if there is no remainder ... even Divide by 2 and if there is a remainder ... odd

I wish I had this kind of idea.

■ Determine whether the number entered from the keyboard is odd or even Add ↓ to the shape of the person who can input with the usual keyboard

#### `python`

``````
int num1;

System.out.print("Enter an integer> ");

if (num1 % 2 == 0){         //When there is no remainder after dividing by 2
System.out.println("The entered number is an even number");
} else if (num1 % 2 == 1){     //If there is a remainder, this is it
System.out.println("The entered number is odd");
}
``````

"Else if" could have been "else" I wanted to add a conditional expression somehow, so I set it to "else if".

# Judge whether it is a multiple of 〇

After writing the conclusion, I should have used "%" in the conditional expression of if.

When I do four arithmetic operations, I always use "remainder" I thought, but I see, I used it "again".

When it is a multiple of 3 Divide by 3 and if there is no remainder ... a multiple of 3 Divide by 3 and if there is a remainder ... not a multiple of 3

After writing, I noticed that even numbers are multiples of 2. What a weakness in math.

■ Determine if the number entered from the keyboard is a multiple of 3 Add ↓ to the shape of the person who can input with the usual keyboard

#### `python`

``````
int num1;

System.out.print("Enter an integer> ");