We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Java
- Introduction
- Java If-Else
- Discussions
Java If-Else
Java If-Else
Sort by
recency
|
1955 Discussions
|
Please Login in order to post a comment
(https://www.google.com)
import java.util.*; class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int n=sc.nextInt();
}
import java.util.*; public class pr { public static void main(String args[]){ Scanner sc = new Scanner(System.in);
}
}
if(N%2==1) { System.out.println("Weird"); } else if(N%2==0 && N>=2 && N<=5) { System.out.println("Not Weird"); } else if(N%2==0 && N>=6 && N<=20) { System.out.println("Weird"); } else if (N%2==0 && N>=20) { System.out.println("Not Weird"); } scanner.close();
}