Leap year or Not leap year
This program checks whether the entered year is a leap year. So first you should include the stdio header file using the "include" command in front of the # sign, which indicates that the header file should be processed before compiling, so name the preprocessor directive.
Next you should define the main() function and declare it empty so it will return a number by default. Now in main() you have to declare a variable year of integer type. You should then use the printf() command to display the following message: "Enter the year to check if it is a leap year". scanf() is then used to take the user's input and store it in the "year" variable. Then you have to give a condition whether 400% is equal to 0 or not; if so, print the given year as a leap year. Using the else function is to check if year100% of the other condition is equal to 0 and print if the year is not a leap year. Another condition is checked whether %4 year is equal to 0. If the condition is true, printf() prints the message - the given year is a leap year, otherwise it prints that the year is not a leap year
return 0 at the end; The statement is used to send an integer type value to main().
কোন মন্তব্য নেই
একটি মন্তব্য পোস্ট করুন