All pastes #986842 Raw Edit

Untitled

public text v1 · immutable
·published 2008-04-16 00:46 UTC
rendered paste body
// 5.c -- convert distance in light years to astronomical units
#include <iostream>
double lightyear_convert(double);
using namespace std;

int main()
{
        double lightyears, ast_units;
        cout << "Enter the number of light years: ";
        cin >> lightyears;
        ast_units = lightyear_convert(lightyears);
        cout << lightyears << " light years = ";
        cout << ast_units << " astronomical units." << endl;
        return 0;

}

double lightyear_convert(double lightyears)
{
        return lightyears * 63240;
}