0

Whats wrong with my code?

import java.util.Scanner; public class numbereveorodd { public static void main(String args[]) { int x; Scanner sc=new Scanner(System.in); System.out.println("enter any number:"); x=sc.nextInt(); if (x%2==0) { System.out.println("number is even"); } else { System.out.println("number is odd"); } } }

6th Mar 2020, 1:53 AM
Shankar Devaraju
Shankar Devaraju - avatar
2 ответов
0
I don't see any problem with your code. What is it that you want to know?
6th Mar 2020, 2:05 AM
Avinesh
Avinesh - avatar
0
While runtime, it got error why bro. Could u please correct me?
6th Mar 2020, 12:41 PM
Shankar Devaraju
Shankar Devaraju - avatar