Answers for "java coding if else statement"

5

if else in java

import java.io.*;
public class JavaIfElse
{
   public static void main(String[] args)
   {
      int number = 15;
      // check if number is divisible by 2
      if(number%2 == 0)
      {
         System.out.println(number + " is even number");
      }
      else
      {
         System.out.println(number + " is odd number");
      }
   }
}
Posted by: Guest on January-15-2021
5

if else in java

import java.io.*;
public class JavaIfElse
{
   public static void main(String[] args)
   {
      int number = 15;
      // check if number is divisible by 2
      if(number%2 == 0)
      {
         System.out.println(number + " is even number");
      }
      else
      {
         System.out.println(number + " is odd number");
      }
   }
}
Posted by: Guest on January-15-2021
0

if else java

public class TestIfElse {

    public static void main(String[] args) {
        int a = 5, b = 6;
        if (a > b) {
            System.out.println("a is greater");
        } else {
            System.out.println("b is greater");
        }
    }
}
Posted by: Guest on November-24-2020
0

if else java

public class TestIfElse {

    public static void main(String[] args) {
        int a = 5, b = 6;
        if (a > b) {
            System.out.println("a is greater");
        } else {
            System.out.println("b is greater");
        }
    }
}
Posted by: Guest on November-24-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language