import std.c.stdio; import std.stdio; // number of kilometers in a astronomical unit const real au = 148800000.0; // number of kilometers in a light year based on light second being exactly 300,000km const real ly = 9467280000000.0; real n; real x; real y; int main() in { assert(au is 148800000.0); // ensure that au is exactly 1,448,800,000km assert(ly is 9467280000000.0); // ensure that ly is exactly 9,467,280,000,000km } body { writef("Enter number of light years: "); scanf("%f", x); // convert light years to kilometers y = x * ly; // convert kilometers to astonomical units n = y / au; writefln("\nThe number of astronomical units is %f", n ); return 0; }