Temperature Converter Code#include <stdio.h>
#include <stdlib.h> int main() { printf("Enter Temperature in Celsius. "); int C; scanf("%d",&C); int F = C*9/5 + 32; printf("%d degrees Fahrenheit",F); return 0; } |
Temperature Converter DetailsThis code will convert Celsius to Fahrenheit. When the code is ran the printf() will act as a spot to enter the number of Celsius. Then the code takes the number you entered and runs it through an equation to convert the Celsius to Fahrenheit. Lastly the code prints out the end result in degrees Fahrenheit.
|
Real Time Applications
This code could be modified to convert many different items. It could be used to convert money or measurements. In a way this acts like a calculator and can be used to build a larger and more complex calculator program.