#include #include int main() { double light_minute; double light_second; double distance; double elapse_minutes; double elapse_seconds; int minute; int second; // 12 // light year 9.46 * 10 // // i.e. 9.46 * 10 to the power 12 const double light_year=9.46*pow(10.0,12); light_minute=light_year/(365.25*24.0*60.0); light_second=light_minute/60.0; distance = 150.0 * pow(10.0,6); elapse_minutes = distance/light_minute; elapse_seconds = distance/light_second; minute = elapse_minutes; second = (elapse_minutes-minute)*60; printf(" Light takes "); printf(" %d ",minute); printf(" minutes "); printf(" %d ",second); printf(" seconds\n"); printf(" to reach the earth from the sun \n"); printf(" or %7.3f seconds\n",elapse_seconds); return(0); }