+ 4
import java.util.Scanner;
public class EvenOdd {
public static void main(String[] args) {
Scanner r = new Scanner(System.in);
System.out.print("Enter a number: ");
int num = r.nextInt();
if(num % 2 == 0)
System.out.println("The "+num + " is even");
else
System.out.println("The "+num + " is odd");
}
}
+ 2
if (num % 2 == 0)
//print even
else
//print odd
Btw this is not a right place to give task.
Here you can ask your doubt/problems.
+ 2
AYESHA CODER â¤đ§ââ
You can ask your queries here in Q&A but you have to show your attempts with question so it would be easy to tell where you are doing mistakes.
+ 2
If(num%2==0)
{
System.out.println("even");
}
else
{
System.out.println("odd");
+ 1
Use this thread for the coding challenge but read instructions before posting
https://www.sololearn.com/Discuss/1270852/?ref=app
+ 1
Let me know if my code is right ?
+ 1
Hello guys
now what can you do with what you have learnt coding.
+ 1
Vive MX after learning coding i could be your teacher..đ
0
It seems her code is right btw i was just trying. Next time I will write the whole code...