This Post Contains A C++ Program To Find A Leap Year With Correct Source Code & Output.
This Program Is Written, Compiled & Executed At TurboC3.0 Compiler & Will Help You To Understand The Concept Of 'If...else' From C++ Language. It Is A Well-Structured Program With Proper Comments Which Provides Step-By-Step Description Of Various Features Of The Language In A Simple & Easy-To-Understand Way.
# Note : You Can Simply Copy-Paste The Following Program Or Code Into Compiler For Direct Result.
C++ Program To Find A Leap Year.
/* Declaration Of Header Files */
# include <iostream.h>
# include <conio.h>
/* Start Of Main Program */
void main()
{
/* Declaration Of Variables */
int Num=0;
clrscr();
/* Asking For The Input From User */
cout << " \n Please Enter The Year = \t " ;
cin >> Num ;
/* Code For Determining The Leap Year */
if ( ( Num % 4 == 0 ) && (Num % 100 != 0) || (Num % 400 == 0 ) )
cout << " \n The Entered Year Is A 'LEAP YEAR' " ;
else
cout << " \n The Entered Year Is Not A 'LEAP YEAR' " ;
getch();
}
/* End Of Main Program */
This blog provides an overview about basic structure of C/C++ programs and their execution, which makes it an ideal guidance source for Programmers and Students. Based on practical approach this blog features a wide range of programs, which enables the learner to understand the techniques such as: Simple Programs, Loops, Arrays, Functions, Objects, Operator Overloading, Polymorphism, Files, Graphics, Strings, Sorting and Searching Methods, Stack, Queues, Link-Lists, Trees and Mini-Projects.
Subscribe to:
Post Comments (Atom)
Blog Archive
-
▼
2013
(77)
-
▼
January
(10)
- C++ Program To Find A Leap Year.
- C Program To Find A Leap Year.
- C Program For Variable Exchange - 02.
- C Program For Variable Exchange - 01.
- C Program For Addition Of 'N' Numbers.
- C++ Program For Multiplication Of Two Matrices.
- C Program To Print Hello On Screen/Console.
- C++ Program For Subtraction Of Two Matrices.
- C++ Program For Addition Of Two Matrices.
- C++ Program To Find Highest And Lowest Elements Of...
-
▼
January
(10)
No comments:
Post a Comment