The function then does the task of calculating the age. We find the year y by simply subtracting the values of py and by. We find the month m by subtracting the values of pm and bm if pm>bm. Otherwise, we subtract 1 from y and subtract the quantity (bm – pm) from 12.
Read moreHow do you calculate age in programming?
Approach used below is as follows −
Read moreWhich statement do we use to take input of our age?
Age = int(input(“Enter your age”)) is correct to take input of age from the user in integer form.
Read moreHow do you write a discount program?
3 Answers. You must use something like this: if(score >= 10 && <= 19 ) { discount = 0.20; } else if(score >= 20 && <= 49) { discount = 0.30; } And so on….27 Eyl 2014
Read moreHow do you write a discount program in C?
36 : C Program to Calculate Discount Amount
Read moreHow do you write a discount program in Java?
Java program to calculate discount price :
Read moreWhat is the formula to calculate discount?
The formula to calculate the discount rate is: Discount % = (Discount/List Price) × 100 .
Read more