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 <stdio.h>
# include <conio.h>
/* Start Of Main Program */
void main()
{
/* Declaration Of Variables */
int Num=0;
clrscr();
/* Asking For The Input From User */
printf( " \n Please Enter The Year = \t " );
scanf( " %d " , &Num );
if ( ( Num % 4 == 0 ) && (Num % 100 != 0) || (Num % 400 == 0 ) )
printf ( " \n The Entered Year Is A 'LEAP YEAR' " );
else
printf ( " \n The Entered Year Is Not A 'LEAP YEAR' " );
getch();
}
/* End Of Main Program */
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 <stdio.h>
# include <conio.h>
/* Start Of Main Program */
void main()
{
/* Declaration Of Variables */
int Num=0;
clrscr();
/* Asking For The Input From User */
printf( " \n Please Enter The Year = \t " );
scanf( " %d " , &Num );
if ( ( Num % 4 == 0 ) && (Num % 100 != 0) || (Num % 400 == 0 ) )
printf ( " \n The Entered Year Is A 'LEAP YEAR' " );
else
printf ( " \n The Entered Year Is Not A 'LEAP YEAR' " );
getch();
}
/* End Of Main Program */
No comments:
Post a Comment