16K views

Uploaded by Saiyasodharan

c program to check whether the given year is leap year or not

save

- am2
- 2010-2011 ICA lab EC05301
- 6226_1_Attachment - C Programming Contest
- C Programmes
- ed fe blue print
- 10 Challenging Star Pattern Programs in C
- simple c programs
- Cryptarithmetic
- 21 Sticks Game
- BOINC Presentation
- CPP program to do arithmetic operations
- C program to implement evaluation of Postfix expression using Stack
- C Program to implement Infix to Postfix Expression conversion algorithm
- C program for Binary Search Tree Traversal
- CPP program to do string manipulations
- C program for Binary Search Tree
- C Program to find sum of cubic roots of individual digits of a number
- C program for list implementation using linked list
- C program to convert character to ASCII and to find the sum of digits of ASCII value
- C program to find sum of integers between 1 and 100 which are divisible by 3 and 5
- C program for list implementation using array
- C program to find sum of integers between 201 to 300 whose individual digits are prime in nature

Program Logic: If the year is divisible by 4, it is a leap year. But, if it is divisible by 100, it is not. If the year is divisible by 400, it is a leap year. Examples: 1. 1996 is a leap year. (divisible by 4) 3. 2100 is a not leap year. (divisible by 100) 2. 2000 is a leap year. (divisible by 100 but also divisible by 400) Program: #include<stdio.h> #include<conio.h> void main() { int year; clrscr(); printf("Enter a Year to check : "); scanf("%d", &year); if(year % 400 == 0) printf("%d is a Leap Year.", year); else if(year % 100 == 0) printf("%d is not a Leap Year.", year); else if(year % 4 == 0) printf("%d is a Leap Year.", year); else printf("%d is not a Leap Year", year); printf("\nPress any key to Quit..."); getch(); } More useful programs @ http://www.gethugames.in/blog/

- am2Uploaded bytalhask
- 2010-2011 ICA lab EC05301Uploaded byrajasripathi
- 6226_1_Attachment - C Programming ContestUploaded byZe Eagle
- C ProgrammesUploaded byMOON387
- ed fe blue printUploaded bytalhask
- 10 Challenging Star Pattern Programs in CUploaded byVinay Singh
- simple c programsUploaded bygrsrik
- CryptarithmeticUploaded bymenonharsh

- 21 Sticks GameUploaded bySaiyasodharan
- BOINC PresentationUploaded bySaiyasodharan
- CPP program to do arithmetic operationsUploaded bySaiyasodharan
- C program to implement evaluation of Postfix expression using StackUploaded bySaiyasodharan
- C Program to implement Infix to Postfix Expression conversion algorithmUploaded bySaiyasodharan
- C program for Binary Search Tree TraversalUploaded bySaiyasodharan
- CPP program to do string manipulationsUploaded bySaiyasodharan
- C program for Binary Search TreeUploaded bySaiyasodharan
- C Program to find sum of cubic roots of individual digits of a numberUploaded bySaiyasodharan
- C program for list implementation using linked listUploaded bySaiyasodharan
- C program to convert character to ASCII and to find the sum of digits of ASCII valueUploaded bySaiyasodharan
- C program to find sum of integers between 1 and 100 which are divisible by 3 and 5Uploaded bySaiyasodharan
- C program for list implementation using arrayUploaded bySaiyasodharan
- C program to find sum of integers between 201 to 300 whose individual digits are prime in natureUploaded bySaiyasodharan