We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,382 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

c programming

help me with a c program that inputs a year number and number of years,then to determine which of those years were leap years

5
Contributors
3
Replies
3 Hours
Discussion Span
9 Months Ago
Last Updated
4
Views
kudakwashe.kadzungura
Newbie Poster
1 post since Aug 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

store the years in an array,
loop through the array and print out the element if it is properly divisible by 4

zeroliken
Nearly a Posting Virtuoso
1,346 posts since Nov 2011
Reputation Points: 214
Solved Threads: 205
Skill Endorsements: 14

You do not need to store the years, just do for loop after determining the last year you need to test and do function for testing for leap year you call inside the loop.

pyTony
pyMod
Moderator
6,310 posts since Apr 2010
Reputation Points: 879
Solved Threads: 987
Skill Endorsements: 26

Post how far you have been able to code it.

np complete
Posting Whiz
385 posts since Sep 2010
Reputation Points: 18
Solved Threads: 36
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0575 seconds using 2.63MB