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
A VPN is able to provide secure communication
Answers (1)
How to drive more website traffic?
Answers (1)
Write a function summarize_letters that receives a string and returns a list of tuples containing the unique letters and their frequencies in the string. Test your function and display each letter with its frequency.
Answers (1)
Protected base class members cannot be accessed by: a. friends of the base class. b. friends of derived classes. c. Functions that are not derived-class member functions. d.
Answers (1)
Apakah ada yang bisa menjelaskan potongan source code ini? string fuse (char kata1[100], char kata2[100]) { char jawaban[100]; int ssr, j=0; if (strlen (kata1) >=strlen (kata2)) { ssr = strlen (kata1); }else{ssr = strlen (kata2); }; for (int i=0;
Answers (1)
New Questions in Computers and Technology
You manage a server that runs your company Web site. The Web server has reached its capacity, and the number of client requests is greater than the server can handle.
Answers (1)
What does the acronym API stand for? A. aggregate programming interface B. appropriate placement interface C. applied partial interpol D. application programming interface
Answers (2)
Polymorphic refers to a malware
Answers (1)
6. Social Security is a federal program created in 1965 to provide a financial safety net to older Americans. True False 7. The ability to set attainable goals is important in time management. True False 8.
Answers (1)
How might your use of computers and knowledge of computers affect your personal and professional success
Answers (1)