You are not logged in. Please login at www.codechef.com to post your questions!

×

How can i write same this program on visual basic ?

hi i'm a beginner in programming i like to write a program same in this link http://easycalculation.com/date-day/age-calculator.php so i want the code for it thanx

asked 29 Jul '13, 16:49

fade's gravatar image

0★fade
1111
accept rate: 0%

edited 29 Jul '13, 20:47

admin's gravatar image

0★admin ♦♦
19.0k348495533


You like to write a program for the same and u want to get code at the same time, contradicting your words, what an irony :-o :-o

Instead of code, I can give you logic so that you can help youself, just think like a 10 years old boy, if someone ask you, what is your age then what will you do, you will count number of years from your date of birth to till date ( or the future date), which is nothing but you are taking difference between two dates,

Just like if I ask you how many numbers are there in between 1 to 10 that is nothing but the difference between 10 and 1 i.e., 9

for yyyy-mm-dd format

substract dd(date of birth) from dd(todays date) only,

mm from mm only

and yyyy from yyyy just like simple substraction.

if suppose todays date is 12 sept 2013 and date of birth is 31 aug 1992 how will you deduct 31 from 12 then you will need carry, borrow one month from mm i.e., 30 days and now you can substract 31 from 42(12+30). same with year and month and you will get your age in years, months and days, convert year into month and days for age in days or months accordingly.

Hope You got my words.

Thank you and all the best :)

link

answered 29 Jul '13, 17:29

hrculiz's gravatar image

1★hrculiz
506914
accept rate: 0%

edited 29 Jul '13, 17:33

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×863
×228

question asked: 29 Jul '13, 16:49

question was seen: 768 times

last updated: 29 Jul '13, 20:47