C++

C++
Last edited on
You better get to it, then.
closed account (48T7M4Gy)
1
2
3
4
5
#include<>

int main() {
 return 0;
}
Not sure what that formula is for, but:
1
2
3
4
5
6
7
8
9
10
11
#include <iostream>
#include <string>

int main() {
    // needed so it can be changed
    std::string it;
    // ask the user for the temperature in Celsius
    std::cout << "the temperature in Celsius?";
    // change it to Fahrenheit
    it = "Fahrenheit";
}

Haven't tested it myself, but here you go.
For shits and giggles...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <iostream>

float toFahrenheit(const float &C)
{
	return (C * 9/5) + 32;
}

int main()
{
	float C;
	std::cout << "Temperature in Celcius: ";
	std::cin >> C;
	
	std::cout << toFahrenheit(C);
	
	return 0;
}
Last edited on
nice!
Topic archived. No new replies allowed.