+ 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"); } }
9th Oct 2022, 5:47 PM
Vaibhav
Vaibhav - avatar
+ 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.
9th Oct 2022, 4:09 PM
A͢J
A͢J - avatar
+ 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.
9th Oct 2022, 4:20 PM
A͢J
A͢J - avatar
+ 2
If(num%2==0) { System.out.println("even"); } else { System.out.println("odd");
10th Oct 2022, 8:28 AM
Omprakash
Omprakash - avatar
+ 1
Use this thread for the coding challenge but read instructions before posting https://www.sololearn.com/Discuss/1270852/?ref=app
9th Oct 2022, 4:11 PM
A͢J
A͢J - avatar
+ 1
Let me know if my code is right ?
10th Oct 2022, 9:38 AM
Omprakash
Omprakash - avatar
+ 1
Hello guys now what can you do with what you have learnt coding.
10th Oct 2022, 9:42 AM
Vive MX
Vive MX - avatar
+ 1
Vive MX after learning coding i could be your teacher..😂
10th Oct 2022, 9:46 AM
Omprakash
Omprakash - avatar
0
It seems her code is right btw i was just trying. Next time I will write the whole code...
10th Oct 2022, 9:44 AM
Omprakash
Omprakash - avatar