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
Liza is making a presentation on the sales revenue of her surfboard company's most popular surfboard models. She wants to emphasize the model names as they appear one by one on the presentation slide.
Answers (1)
Drag the tiles to the correct boxes to compete the pairs. Match the features of a word processing software to their corresponding functions. Enables you to add or remove misspelled words. Provides the fescription of a grammar errors.
Answers (2)
Which is a good guideline for writing a strong thesis statement?
Answers (1)
When on a LAN switch DHCP snooping is configured the networks that can be accessed by which clients?
Answers (1)
Write a converter program for temperatures. This program should prompt the user for a temperature in Celsius. It should then convert the temperature to Fahrenheit and display it to the screen.
Answers (1)
New Questions in Computers & Technology
Quick! Select the correct answer. Which is an example of static web page? A. the About Us page B. the current affairs page C. the ads in a website D. the weather ticker
Answers (2)
Write an if statement that prints the message "Application accepted" if the variable workExperience is greater than or equal to 2 or the variable hasCollegeDegree is true.
Answers (2)
How do you start your car with an EIF system
Answers (1)
On the UB-04 claim form, the type of bill is identified by a four-digit numerical code. The first digit is a leading zero, what does the second digit represent?
Answers (1)
WLAN uses radio waves to transmit data between wireless devices. True or False
Answers (1)