-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
129077d
commit 1437e0d
Showing
3 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
I did not consult with anyone else on this assignment, all code found in this folder, with the exception of test_m.py, is written by Thien K. M. Bui |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/*temperature.c | ||
Written by Thien K. M. Bui | ||
Last modified 01-25-22 | ||
*/ | ||
|
||
#include <stdio.h> | ||
|
||
int main() { | ||
float input; | ||
printf("What is the temperature in degrees Fahrenheit? "); | ||
scanf("%f", &input); | ||
|
||
if (input <= -459.67){ | ||
printf("Invalid temperature!\n"); | ||
}else{ | ||
float temp_celsius = (input - 32) * 5/9; | ||
printf("%f degrees Fahrenheit is %f Celsius\n", input, temp_celsius); | ||
} | ||
return 0; | ||
} |