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
An iphone is a form of a computer
Answers (2)
Which programming language uses mnemonic code to represent data, instructions, and memory locations? A. machine language B. assembly language C. C D. Java
Answers (1)
Whenever students turn in their homework, a teacher rewards them with computer time. The more often they turn in their homework, the more they are allowed to use the computers. Students have been turning in their homework with increasing frequency.
Answers (1)
You have spent the last two weeks getting your community ready for the prime time and have recently deployed your configuration to production and now wish to make it publicly available. What steps do you take to do this? a.
Answers (1)
The engine type that is fired by gas or oil
Answers (2)
New Questions in Computers and Technology
If an external server needs to communicate with servers inside the green zone, which network setting on smoothwall can be opened?
Answers (1)
Detailed ___ highest risk warnings can incude identifiying which vendor updates apply to which vulnerablities as well as which types of defenses have been found to work against the specific vulnerabilities reported.
Answers (1)
As they relate to databases, which of the following describes forms? A. Forms are a type of input used to generate reports. B. Forms are a type of output used to display data generated from queries. C.
Answers (1)
What is needed to create a good problem statement?
Answers (1)
Both of the following for clauses would generate the same number of loop iterations. for num in range (4): for num in range (1, 5) :
Answers (1)