we get month for (month=days/30;) years for ( years=month/12;) but we also get days for(( days=days%30, why it happend explain ??))
hadisur_rahman
0
Newbie Poster
Recommended Answers
Jump to PostIt's wrong. It's an approximation that assumes every month has 30 days.
Jump to PostPer David W's post, modular arithmetic returns the remainer of a division operation, so 4%2 is the remainder of 4/2 which is 0. If there are 30 days in a month, then if it is the 15th of the month, the remainder of 15/30 is 15, so 15%30 == 15. …
All 6 Replies
Moschops
683
Practically a Master Poster
Featured Poster
rubberman
1,355
Nearly a Posting Virtuoso
Featured Poster
rubberman
1,355
Nearly a Posting Virtuoso
Featured Poster
hadisur_rahman
0
Newbie Poster
David W
131
Practically a Posting Shark
rubberman
1,355
Nearly a Posting Virtuoso
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.