Created
January 21, 2022 09:03
-
-
Save smyy96/b93d95862d90a9b4929adcbaccf17d83 to your computer and use it in GitHub Desktop.
Patika Java 101 - Artık Yıl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class artikYil { | |
public static void main(String[] args) { | |
Scanner input = new Scanner(System.in); | |
int yil,artik=0, artikY=0; | |
System.out.print("Yıl Giriniz : "); | |
yil = input.nextInt(); | |
artik=yil%4; | |
artikY=yil%100; | |
if (artik==0) | |
if ((artikY==0)&&(yil%400==0)) | |
System.out.print(yil+" bir artık yıldır !"); | |
else if((artikY==0)==false) | |
System.out.print(yil+" bir artık yıldır !"); | |
else | |
System.out.print(yil+" bir artık yıl değildir !"); | |
else | |
System.out.print(yil+" bir artık yıl değildir !"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment