I this article I would like to share with you a sample program that will show how to use structure in C++ to check the leap year.
programming projects, thesis and capstone projects, IT consulting
work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise in my website kindly contact me also in my email address also. Thank you.
I am currently accepting programming work, it projects, school
programming projects, thesis and capstone projects, IT consulting
work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise in my website kindly contact me also in my email address also. Thank you.
My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.
My mobile number here in the Philippines is 09173084360.
My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.
My personal website is http://www.jakerpomperada.com
My personal website is http://www.jakerpomperada.com
Sample Program Output
Program Listing
// leap_year.cpp
// Author : Mr. Jake R. Pomperada, BSCS,MAED-IT
// Date : September 3, 2018 Monday 4:42 PM
// Location : Bacolod City, Negros Occidental Philippines.
// Website : http://www.jakerpomperada.com
// Email : jakerpomperada@jakerpomperada.com and jakerpomperada@gmail.com
// Tool : Dev C++ Version 5.11
#include <iostream>
using namespace std;
struct leap_year {
int year;
};
int main()
{
struct leap_year years;
system("COLOR F0");
cout << "\n\n";
cout << "\tLeap Year Checker Using Structure";
cout <<"\n\n";
cout << "\tEnter Year : ";
cin >> years.year;
cout <<"\n";
if(years.year%4==0)
{
if(years.year%100==0)
{
if(years.year%400==0)
cout <<"\tThe Given Year " <<years.year << " is a Leap Year.";
else
cout <<"\tThe Give Year " <<years.year <<" Not a Leap Year.";
}
else
cout <<"\tThe Given Year " <<years.year <<" is a Leap Year.";
}
else {
cout <<"\tThe Given Year " <<years.year<< " Not a Leap Year.";
}
cout <<"\n\n";
cout <<"\tEND OF PROGRAM";
cout <<"\n\n";
}
No comments:
Post a Comment