~riderius/cpp-code

cpp-code/Light_years_to_Astronomical_Units_Converter.cpp -rw-r--r-- 361 bytes
380d65aariderius digits_analysis.cpp: argv[1] can replace n 9 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <iostream>

using namespace std;

double converter(double);

int main()
{
    double light_years;
    cout << "Enter the number of light years: ";
    cin >> light_years;
    cout << light_years << " light years = " << converter(light_years) << " astronomical units." << endl;
}
double converter(double light_years)
{
    return light_years * 63240;
}