LEAP YEAR
void main ()
{
int a;
clrscr ();
printf ("Enter the Year: ");
scanf("%d",&a);
if (a%400==0)
{
printf ("\nYear is Leap");
}
else
{
printf("\nYear is not Leap");
}
getch ();
}//WAP to find out Year is leap or not (switch case)
#include<stdio.h>
#include<conio.h>
int main ()
{
int a;
//clrscr();
printf ("Enter the Year: ");
scanf("%d",&a);
a=a%400;
switch(a)
{
case 0:
{
printf ("\n Leap Year");
break;
}
default:
{
printf("\n Not Leap Year");
break;
}
}
getch ();
}
// about leap year: http://www.infoplease.com/spot/leapyear1.html
কোন মন্তব্য নেই:
একটি মন্তব্য পোস্ট করুন