Ask 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 year = 12 months

1 month = 30 days

+1
Answers (1)
  1. 20 May, 04:52
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers
You Might be Interested in
To share a document in my online electronic journal, I should select the option to
Answers (1)
What is a device that encodes an analog signal as a digital signal.?
Answers (1)
What number is needed to complete the pattern 66, 73, 13, 21, 52,_, 10, 20?
Answers (1)
What is the definition of a website
Answers (1)
Gina wants to consistently format the headings in all of her worksheets. A. Format the heading text in one worksheet, copy it using Format Painter, and then paste it into the other worksheets. B.
No Answers
New Questions in Computers & Technology
Jack needs to improve sales on a local service for the elderly. What would be the best place for him to place an ad? fast-food websites downtown buses social media campaigns local news channels
Answers (2)
To whom are intranet resources available? Everyone that has access to the internet Just those people connected to the LAN People you add as your friends Just yourself
Answers (1)
Which of the following would be considered a primary source of information? a. a consumer web site b. an abstract c. an index d. an original research report
Answers (1)
Which component detects both single-bit and multi-bit errors?
Answers (1)
How are companies protecting their users from internet assault
Answers (1)