Java program that Compute Easter Sunday using the algorithm invented by mathematician Carl Friedrich Gauss in 1800
###### Posted by Samath
Last Updated: February 11, 2021

Write a Java program that Computes Easter Sunday using the algorithm invented by mathematician Carl Friedrich Gauss in 1800.

Code:

```import java.util.Scanner;

public class Main
{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int f1;
int f14;
int f2;
int f3;
int f4;
int f5;
int f6;
int f7;
int f8;
int f9;
int f10;
int f11;
int f12;
int f13;

System.out.print("Current year: ");
f14 = input.nextInt();
input.close();
f1 = f14 % 19;
f2 = f14 / 100;
f3 = f14 % 100;
f4 = f2 / 4;
f5 = f2 % 4;
f6 = (8 * f2 + 13) / 25;
f7 = (19 * f1 + f2 - f4 - f6 + 15) % 30;
f8 = f3 / 4;
f9 = f3 % 4;
f10 = (f1 + 11 * f7) / 319;
f11 = (2 * f5 + 2 * f8 - f9 - f7 + f10 + 32) % 7;
f12 = (f7 - f10 + f11 + 90) / 25;
f13 = (f7 - f10 + f11 + f12 + 19) % 32;
System.out.println("Easter falls on " + f13 + "/" + f12 + "/" + f14);
}
}
```
###### Zellerâ€™s algorithm in Python
Samath | Mar 12, 2015
###### Java program that uses a loop to compute the sum of all even numbers between 2 and 100 (inclusive)
Samath | Apr 03, 2022
###### C Program to Compute sum of the array elements using pointers
Samath | Jan 02, 2017
###### Java program that uses a loop to compute the sum of all squares between 1 and 100 (inclusive)
Samath | Apr 03, 2022
###### Java program that uses a loop to compute the sum of all even numbers between a and b (inclusive), where a and b are inputs
Samath | Apr 03, 2022
###### Java program that compute the average test score for a student and assign the appropriate letter grade
Samath | Jan 17, 2024
###### Java program that uses a loop to compute the sum of all odd digits of an input. (For example, if the input is 32677, the sum would be 3 + 7 + 7 = 17.)
Samath | Apr 03, 2022