C++ program to check leap year : c++ code to check leap year, year will be entered by the user.
Simply use of nested if else property..
Source Code:-
#include<iostream.h>
#include<conio.h>
void main()
{ clrscr();
int year;
cout<<"Program to check Leap year by-Tarun Rawat\n";
cout<<"Enter a year to check : ";
cin>>year;
if ( year%400 == 0)
cout<<year<<" is a leap year\n";
else if ( year%100 == 0)
cout<<year<<" is not a leap year\n";
else if ( year%4 == 0 )
cout<<year<<" is a leap year\n";
else
cout<<year<<" is not a leap year\n";
getch();
}
Welcome to " way2cplusplus.blogspot.in " Objective of this blog is to implement various Computer Science Engineering Lab problems into C++ programming language. These are basically most common Lab Exercise problems based on the curriculum of engineering colleges throughout the Nation. These lab exercises are also relevant to Data structure. Simply C++ programming zone...
No comments:
Post a Comment