~riderius/cpp-code

cpp-code/Celsius_to_Fahrenheit_converter.cpp -rw-r--r-- 428 bytes
380d65aariderius digits_analysis.cpp: argv[1] can replace n 11 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <iostream>
using namespace std;

double converter(int celsius);

int main()
{
    int celsius;
    while (true) {
        cout << "PLease enter a celsius value: ";
        cin >> celsius;
        cout << celsius << " degrees Celsius is " << converter(celsius) << " degrees Fahrenheit." << endl;
    }
    return 0;
}

double converter(int celsius)
{
    double Fahrenheit = celsius * 1.8 + 32;
    return Fahrenheit;
}