How To: Write C++ Leap Year Program in Dev C++

 


#include<iostream>
#include<stdio.h>
#include<conio.h>


using namespace std;

int main()
{

 int year;

 cout << "*** PROGRAM TO GET LEAP YEAR ***";

 cout << "\n\nEnter: ";
 cin >> year;

 if (( year % 4 == 0 && year % 100 !=0 ) || ( year % 400 == 0 ) )
 {

  cout << "It's a leap year";
 } else {


  cout << "\nIt's not a leap year.";

 }

 getch();
 return 0;
}


How To: Write C++ Leap Year Program in Dev C++ How To: Write C++ Leap Year Program in Dev C++ Reviewed by Prakash Bera on September 15, 2015 Rating: 5

No comments:

Powered by Blogger.
affiliates@godaddy.com