Start a new topic

Plezmo

How to compare two person ages, for example, Rita age is 15 years 10 months 2 days and Meena age is 7 years 6 months and 56 days then what code we will give to the computer so that it appears on the label that Rita is older than Meena by this default age.

Hoping for the Best

Yours Faithfully

Pavan

1 Comment

Hello ,


You can use the math operators to convert all the age numbers to days. Once you have converted them to days then you can use the logical operators to check which one is older and display a label accordingly.

Login to post a comment