こんにちは、プログラミング初心者です。関数の仕組みと if ステートメントを知っているので、if & else ステートメントを関数に記述し、ユーザーに回答を表示する方法を知りたいです。goto ステートメントがない可能性があります
コードは次のとおりです。
if(year < 1583) //considers if a year input is less than 1583 which is the starting year for this calendar
{
printf("\n\nPlease select a year after 1583 \n\n");
goto YEAR;
system("cls");
}
if(Leap_year(year))//if statement calls Leap Year function
{
printf("\t ======================= \n");
printf("\t* THIS IS A LEAP YEAR *\n");
printf("\t ======================= \n\n");
}
else {
printf("\t ======================= \n");
printf("\t* THIS IS NOT A LEAP YEAR *\n");
printf("\t ======================= \n\n");
}