The number of lines in your program is to much due to which the program may become slow. import java.util.Scanner; public class EvenOdd2 { public static void main(String[] args) { int num; System.out.println("Enter any number"); Scanner sc=new Scanner(System.in); num=sc.nextInt(); if(num%2==0) System.out.println("Even Number"); else System.out.println("Number Odd" ); } }
I Love your channel and explanations. It's been helping me a lot. Thank you.
Welcome :)
The number of lines in your program is to much due to which the program may become slow.
import java.util.Scanner;
public class EvenOdd2
{
public static void main(String[] args)
{
int num;
System.out.println("Enter any number");
Scanner sc=new Scanner(System.in);
num=sc.nextInt();
if(num%2==0)
System.out.println("Even Number");
else
System.out.println("Number Odd" );
}
}
Nice explanation 🙌
Thank you :)
@@QAFox mention not!
Are bhai tune isprime = false
If or else dono me lia hai tho else ka matlab kya hai bhai
SIR YE BINA METHOD KE KARO...HAR JAGA METHOD NHI LAGA SAKTE