C programming examples with output
To Check Leap Year Or Not
Program
#include<stdio.h>
#include<conio.h>
main()
{
int year,i;
clrscr();
printf("Enter year : ");
scanf("%d",&year);
if(year%4==0)
printf("%d is a leap year.",year);
else
printf("%d is not a leap year.",year);
getch();
}
Output:
Enter year:2020
2020 is a leap year.
Enter year:2017
2017 is not a leap year.
Best Budget Laptop For Web Developers 2019
To Check Leap Year Or Not
Program
#include<stdio.h>
#include<conio.h>
main()
{
int year,i;
clrscr();
printf("Enter year : ");
scanf("%d",&year);
if(year%4==0)
printf("%d is a leap year.",year);
else
printf("%d is not a leap year.",year);
getch();
}
Output:
Enter year:2020
2020 is a leap year.
Enter year:2017
2017 is not a leap year.
Best Budget Laptop For Web Developers 2019
0 komentar:
Post a Comment