in Education by
class year { public static void main() { int a=2000; if( a%4 == 0 && a%100 != 0); { System.out.println(“It is a leap year”); } else if(a%400 == 0); { System.out.println(“It is a century leap year “); } else; { System.out.println(” It is a century year but not a leap year”); } } } what I have done wrong in this it is showing 2 errors Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
Answer: No semicolon required after else, if, else if

Related questions

0 votes
    class Modulus { public static void main(String args[]) { double a = 25.64; int b = 25; a = a % 10; b = b % 10; ... (a + + b); } } Select the correct answer from above options...
asked Dec 19, 2021 in Education by JackTerrance
0 votes
    #include int main() { void fib(int f1,int f2, int n) { static int i = 1; int f3; if(i...
asked Dec 19, 2021 in Education by JackTerrance
0 votes
    #include int main() { void fib(int f1,int f2, int n) { static int i = 1; int f3; if(i...
asked Dec 18, 2021 in Education by JackTerrance
0 votes
    int find(int i) { if(>1) j=find(j/10)+(j%10) else j=0; return j; void main() int i=1000 int k k=find(i): printf(“%d”, K) Select the correct answer from above options...
asked Dec 29, 2021 in Education by JackTerrance
0 votes
    int find(int j) { if(>1X j=find(j/ 10)+(%10); } else { j=0; return j; void main() int i=1000, int k; k=find(i); printf(“%d”, k); Select the correct answer from above options...
asked Dec 29, 2021 in Education by JackTerrance
0 votes
    Which is a valid declaration within an interface? A)protected short stop = 23; b)final void madness(short stop); ... (double duty);? Select the correct answer from above options...
asked Dec 1, 2021 in Education by JackTerrance
0 votes
    int fun(int n) { if(n!=0) { return n – fun(n-5); } else { return n; } } int main(){ int n = 20, z; z = fun(n); printf(“%d”, z); } Select the correct answer from above options...
asked Dec 31, 2021 in Education by JackTerrance
0 votes
    6. A business man wishes to accumulate 3000 shares of a company. However, he already has some shares of that ... 100/Nominal value*div% Select the correct answer from above options...
asked Nov 27, 2021 in Education by JackTerrance
0 votes
    What is (void*)0? Error re of null pointer re of void pointer none of the listed options? Select the correct answer from above options...
asked Nov 30, 2021 in Education by JackTerrance
0 votes
    do you think the following two expression are the same if yes write the output if not justify your answer X=int(22/7) X=(22.0/7) Select the correct answer from above options...
asked Dec 13, 2021 in Education by JackTerrance
0 votes
    m 1) Int a=0.b=20; for (int i=20;i>=4;i=i-3) { if(i%21=0 a=a+2; ) b=b+a: predict the value of b after execution Select the correct answer from above options...
asked Nov 27, 2021 in Education by JackTerrance
0 votes
    Int a=0.b=20: for (int i=20:i>=4:i=i-3) { if(i%2!=0) a=a+2: 3 b=b+a: . Select the correct answer from above options...
asked Nov 27, 2021 in Education by JackTerrance
...