Write a program that reads the number of years ago that a dinosaur lived and then compute the equivalent number of months, days, and seconds ago. Use 365.25 days per year. Test your program with a triceratops that lived 145 million years ago and a brontosaurus that lived 182 million years ago. (Hint: Use type double for all variables.) Note: Include functions in your program

Respuesta :

Answer:

#include <iostream>

using namespace std;

int main()

{

double year;

cout<<"Enter the number of years"<<endl;

cin>>year;

int month=year*12;

int days=year*365;

int hrs= year*(365*12);

int mins= year*(365*12*60);

int secs= year*(365*12*60*60);

cout<<"Months "<<month<<endl;

cout<<"Days "<<days<<endl;

cout<<"Hours "<<hrs<<endl;

cout<<"Minutes "<<mins<<endl;

cout<<"Secs "<<secs<<endl;

cin>>month;

}

Explanation:

ACCESS MORE