Write a program which take input as n and determines if that is a leapyear
Answers
Answered by
0
which program java or any other
java program.....
class leap year
{
public static void main (int n)
if(n/400)
{
System.out.println("leap year");
else
System.out.println("Not a leap year");
}
}
java program.....
class leap year
{
public static void main (int n)
if(n/400)
{
System.out.println("leap year");
else
System.out.println("Not a leap year");
}
}
Answered by
0
/*
* C program to find whether a given year is leap year or not
*/
void main()
{
int year;
printf("Enter a year \n");
scanf("%d", &year);
if ((year % 400) == 0)
printf("%d is a leap year \n", year);
else if ((year % 100) == 0)
printf("%d is a not leap year \n", year);
else if ((year % 4) == 0)
printf("%d is a leap year \n", year);
else
printf("%d is not a leap year \n", year);
}
Similar questions