Compare commits
2 commits
f4330e53e0
...
32c530ced1
Author | SHA1 | Date | |
---|---|---|---|
32c530ced1 | |||
1b6aabc1b5 |
3 changed files with 40 additions and 0 deletions
15
src/excercises/celsius.cc
Normal file
15
src/excercises/celsius.cc
Normal file
|
@ -0,0 +1,15 @@
|
|||
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
|
||||
int fahrenheit;
|
||||
cout << "Enter fahrenheit value: ";
|
||||
cin >> fahrenheit;
|
||||
double celsius = (fahrenheit - 32) / 1.8;
|
||||
cout << "Celsius: " << celsius;
|
||||
|
||||
return 0;
|
||||
}
|
15
src/excercises/circles.cc
Normal file
15
src/excercises/circles.cc
Normal file
|
@ -0,0 +1,15 @@
|
|||
#include <cmath>
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
|
||||
int radius;
|
||||
cout << "Enter radius of circle: ";
|
||||
cin >> radius;
|
||||
|
||||
// I'm awesome, the teacher didn't know about the PI constant in cmath
|
||||
cout << "Result: " << M_PI * pow(radius, 2);
|
||||
return 0;
|
||||
}
|
10
src/main.cc
Normal file
10
src/main.cc
Normal file
|
@ -0,0 +1,10 @@
|
|||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
Reference in a new issue