Hi,
This is a program finds out the date for Eastern. I get these two errors when compiling:
-invalid operands to binary % (line 14 and 16)
-int format,double arg<arg 2> (line 19)
I don't know how to fix it. Does anyone have a tips on this?
Code:
#include<stdio.h>
#include<stdbool.h>
#include<math.h>
int main()
{
int year;
float A,B,C,S,D,T,E,date;
printf("Choose a year between 1900 to 2099");
year=getchar();
A= year % 19;
B= year %4;
C= year % 7;
S=19*A+ 24;
D=S % 30;
T=2*B+4*C+6*D+5;
E=T % 7;
date=22 + D + E;
if(date==32){
printf("The eastern's date is:%d",date);
}
else if(date!=32){
date=D+E-9;
if(date==26){
printf("The eastern is April 19th.");
}
if(date==25&&A==16&&D==28){
printf("The eastern is April 18th.");
}
}
}