Ask Question
9 July, 02:57

Write a C+ + programme that asks the user to enter his age in days. Calculate then his age in:

Years - Months - Days

1 year = 365 days

1 year = 12 months

1 month = 30 days

+5
Answers (1)
  1. 9 July, 03:23
    0
    C+ + program that asks the user to enter his age in days

    #include

    using namespace std;

    void Findage () / /Defining function

    {

    int a=0, d=0, m=0, y=0, r=0;

    cout<<"Enter Age in Days = "; / /Taking input

    cin>>a;

    if (a>365) / /If age is greater than 365

    {

    y = (a) / 365;

    r=a%365;

    if (r>30)

    {

    m=r/30;

    d=r%30;

    }

    else

    {

    d=r%30;

    }

    }

    else / /if the age is less than 365

    {

    if (a>30)

    {

    m = (a) / 30;

    d=a%30;

    }

    else

    {

    d=a;

    }

    }if (a==365) / /Printing output

    { cout<<"Your Age in Calender"<
    cout<<"Year = 1"<
    }

    else

    {

    cout<<"Your Age in Calender"<
    cout<<"Years = "<
  2. Comment
  3. Complaint
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Write a C+ + programme that asks the user to enter his age in days. Calculate then his age in: Years - Months - Days 1 year = 365 days 1 ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers
You Might be Interested in
How do you calculate the life span of patents? Calculation of the life span of patents starts from the date on which you ___ the patent application.
Answers (1)
A scientist used a laboratory model to test the effect of radiation, or the sun, in heating land and water on Earth. To do this experiment, 200 mL of water and dry sand were placed in to 2 separate 250-mL beakers.
Answers (1)
Create a VBScript script (w3_firstname_lastname. vbs) that takes one parameter (folder name) to do the following 1) List all files names, size, date created in the given folder 2) Parameter =
Answers (1)
Total Purchase (SOWP Ch. 2 Problem 4) : A customer in a store is purchasing five items. Write a program that asks for the price of each item, then displays the subtotal of the sale, the amount of sales tax, and the total. Assume the sales tax is 7.
Answers (1)
Convert octal number 2470 to decimal number
Answers (2)
New Questions in Computers and Technology
What does a linear bus topology used to connect all network devices?
Answers (1)
Which statements describe the Styles gallery? Check all that apply. - It has many different style samples that can be applied. - A user has to hit Shift+F1 to see it. - A user has to hit Insert to see it. - It is found under the Home tab.
Answers (1)
Big Data often involves a form of distributed storage and processing using Hadoop and MapReduce. One reason for this is: A) the processing power needed for the centralized model would overload a single computer.
Answers (1)
Well maintained websites may have an unmaintaned page that has not been updated
Answers (1)
Which term is used as a synonym for data mining?
Answers (2)