public class ProblemSolving {
  
  
  public static void main(String[] args) { 

    //Swapping (exchanging) the values of x and y
    int x = 4;
    
    int y = 10;
    System.out.println("Initially x="+x+"\t y=" + y);
    int temp = x;
    x = y;
    y = temp;
    
    System.out.println("After swap x="+x+"\t y=" + y);
    
    //Even or odd 
    
    int z = 100;
    int d = 4;
    if(z%2==0)
      System.out.println(z+" is an even number.");
    else
      System.out.println(z+" is an odd number.");
    
    //Divisibility
    
    if(z%d==0)
      System.out.println(z+" is a multiple of "+d);
    
  }
  
  //ternary operator
  String word="";
  if(x > 2)
    word = "hello";
  else
    word = "goodbye";
  
  String word = x>2 ? "hello" : "goodbye";
  

  if(grade>=60)
    letter = 'P';
  else 
    letter = 'F'
  
  char letter = grade>=60? 'P' : 'F';
    
  
}
