+ 3

New in java dont know where the error is?

public class IfElse{ public static void main(String[] args) { //defining a variable int number=13; //Check if the number is divisible by 2 or not if(number%2==0){ System.out.println("even number"); }else{ System.out.println("odd number"); } } }

20th Apr 2021, 1:57 AM
Naaz Hussain
Naaz Hussain - avatar
10 Answers
+ 2
Tell your excepted output because there is neither syntax nor logical errors
20th Apr 2021, 2:02 AM
Atul [Inactive]
+ 5
[No Name] please use respect amongst other community members .. They overtime as you get to know them can help you with questions and answers as they arise in your growth.
20th Apr 2021, 2:33 AM
BroFar
BroFar - avatar
+ 1
move the last } a little left then see
24th Apr 2021, 5:13 PM
Redheadedmoos 120
Redheadedmoos 120 - avatar
0
The code doesn't consists of any errors
20th Apr 2021, 2:02 AM
Atul [Inactive]
0
Ok thanku 🙂
20th Apr 2021, 2:06 AM
Naaz Hussain
Naaz Hussain - avatar
0
Hi
21st Apr 2021, 11:43 AM
Maxamed Jamaal
Maxamed Jamaal - avatar