diff options
| author | Asahel <[email protected]> | 2024-01-27 11:29:05 -0800 |
|---|---|---|
| committer | Asahel <[email protected]> | 2024-01-27 11:29:05 -0800 |
| commit | 446425038559e86f5fe73d241e2dccd352aa8f65 (patch) | |
| tree | d7589b6677c9db0ad54dc06541c66a81a7d840b4 /InClassExercise5/InClassExercise5/Source.cpp | |
| parent | Finished Exercise 5 (diff) | |
| download | in-class-exercise-5-asahellt-main.tar.xz in-class-exercise-5-asahellt-main.zip | |
Diffstat (limited to 'InClassExercise5/InClassExercise5/Source.cpp')
| -rw-r--r-- | InClassExercise5/InClassExercise5/Source.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/InClassExercise5/InClassExercise5/Source.cpp b/InClassExercise5/InClassExercise5/Source.cpp index 659be0f..fb42860 100644 --- a/InClassExercise5/InClassExercise5/Source.cpp +++ b/InClassExercise5/InClassExercise5/Source.cpp @@ -5,7 +5,7 @@ #include <iostream> -#include "helpers.h" +#include "Header.h" int main() @@ -50,7 +50,7 @@ float percentage(int a, int b) { } float FtoC(int fah) { - // -32*5/9 + float num = (fah - 32) * (5.0 / 9.0); @@ -58,7 +58,7 @@ float FtoC(int fah) { } float CtoF(int cel) { - // 9/5+32 + float num = (cel * (9.0 / 5.0)) + 32; @@ -68,6 +68,7 @@ float CtoF(int cel) { long factorial(int a) { if (a == 0 || a == 1) + return 1; else return a * factorial(a - 1); |