You are viewing a single comment's thread. Return to all comments →
import java.io.; import java.util.; import java.text.; import java.math.; import java.util.regex.*;
public class Solution { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); String ans=""; if(n%2==1){ ans = "Weird"; } elseif(n%2==0 && 2<=n<=5) { ans = "Not Weird"; } elseif(n%2==0 && 6<=n<=20) { ans = "Weird"; } elseif(n%2==0 && n>20) { ans = "Not Weird"; } System.out.println(ans); } }
It shows compilation error of semicolon after elseif statement.
Seems like cookies are disabled on this browser, please enable them to open this website
Java If-Else
You are viewing a single comment's thread. Return to all comments →
import java.io.; import java.util.; import java.text.; import java.math.; import java.util.regex.*;
It shows compilation error of semicolon after elseif statement.