LEAP YEAR
Problem Description
Raghuraman is the worrisome as well as caring father of his only daughter bharani ,together they live a calm and content life. Over the years as Bharani grows up , Raghuramam got more and more attached to his daughter bharani. As bijarani is very intelligent and bright in her studies. She got a good placement offer in canada. Raghuraman was shocked.Although the thought of being separated from his dead daughter is heartbreaking. Raghuraman wearily accepts. Bharani promises her that she will come home once every leap year. Raghuraman was waiting for his daughter arrival. He doesnt know which is leap year. So write a C program to help Raghumaran to find a whether the year is a leap year.
Input format:
Input consists of single integer which corresponds to a year
Output format :
Displays whether the given year is a leap year or not.
Refer sample input and output for further formatting specifications.
CODING ARENA
#include <stdio.h>
int main()
{
int year;
scanf("%d",&year);
if(year%4==0)
{
printf("Leap Year");
}
else
printf("Not a Leap year");
return 0;
}
Test Case 1
Input (stdin)2004
Expected Output
Leap Year
Test Case 2
Input (stdin)2017
Expected Output
Not a Leap year
No comments:
Post a Comment