Ask Question
28 August, 06:05

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

+3
Answers (1)
  1. 28 August, 06:19
    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?
Get 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 & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers
You Might be Interested in
While performing Before Operations PMCS, you notice the front right tire appears slightly underinflated. What is the proper action?
Answers (1)
My Plate makes recommendations for what you should eat on a monthly basis. True False
Answers (2)
What is the importance of data validation, and how can user data entry errors be reduced or eliminated?
No Answers
Next, Isabela wants to modify a chart in her presentation. How can she access the Chart Tools tab? Click Select in the Editing group. Select the chart she wants to modify. Go the Insert tab, and click Chart. Click once on the outer part of the chart.
Answers (1)
Do any else do odessyware northbranch
Answers (1)
New Questions in Computers & Technology
You have a large company, and it is important to your business that your employees' work is backed up regularly. Which network would provide you with the most security? Centralized Client server GUI Peer-to-peer
Answers (1)
While driving on a highway you have a tire blowout. After you have slowed down and regained control, you should?
Answers (2)
Create an abstract class Homeowner. Your Homeowner class should include the following attributes: First name (string) Last name (string) Homeowner home street address (string) Homeowner home city (string) Homeowner home state (string) Homeowner home
Answers (1)
Does coaxial cable use radio waves to transmit data
Answers (2)
Which command is used to find the number of words, characters, paragraphs, or lines in a Microsoft Word Document?
Answers (1)