Java Program to read two numbers and display its reminder without using the operator %? | StudyEcart

 Q.Java Program to read two numbers and display its reminder without using the operator %?


package impprograms;
import java.util.Scanner;

public class Code23 {

	public static void main(String[] args) {
  
		Scanner sc=new Scanner(System.in);
		System.out.println("Enter the YEAR :");
		int year=sc.nextInt();
		if((year%400==0)||(year%4==0)&&(year%100!=0)) 
			System.out.println("YEAR "+year+"is a Leap Year ");
		else 
			System.out.println("YEAR "+year+"is NOT a Leap Year ");
		
	
	}

}

Note: you can drag the code workspace to see the complete code

Post a Comment

0 Comments