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
If a stadium pays $20,000 for labor and $13,000 for parking, what is the stadium's profit margin if the game generates $206,000 in revenue?
Answers (2)
Which steps will you follow to add lighting to a photograph
Answers (2)
You have a server called server1 that is running windows server 2012. what command would you use to delete the ptr record for 10.1.1.127?
Answers (1)
How would you "break" a firewall in a laptop computer if you were no longer a administrator? (Cyber Security Related, Computers and Technology is the subject.)
Answers (1)
Your time machine is capable of going forward in time up to 24 hours. the machine is configured to jump ahead in minutes.
Answers (1)
New Questions in Computers & Technology
Find the number of ideal integers within the given segment [low, high] inclusive. An ideal number is a positive integer that has only 3 and 5 as prime divisors.
Answers (1)
The part of the computer that provides access to the Internet is what
Answers (2)
Which data type requires the greatest number of bytes in computer memory? A. character B. integer C. single-precision number D. double-precision number E. all require the same amount of storage
Answers (1)
Which one these describe the use of the word wall technique?
Answers (1)
What possible effects could cyber attack have on Johannesburg stock exchange
Answers (1)