Code:
/* Converts a Celsius temperature to Fahrenheit and Kelvin */
#include <stdio.h>
#define FREEZING_PT 32.0f
#define SCALE_FACTOR (9.0f / 5.0f)
int main(void)
{
float fahrenheit, celsius, kelvin;
int m, d, y;
printf ("Enter today's date: (yyyy-mm-dd): ");
scanf ("%d-%d-%d", &y, &m, &d);
printf ("\v");
printf ("TEMPERATURE CHART \n");
printf ("- \t - \t -\t - \t - \t - \t - \t - \t - \t \n"); //explanation border
printf ("This chart will display celsius values ranging from 0 to 100 \nand the corresponding fahrenheit and kelvin conversions, with a \nstep of 10 between each celsius temperature. You may use the \nMenu Options below to change the default settings. \n");
printf ("- \t - \t - \t -\t - \t - \t - \t - \t - \t \n"); //explanation border
printf ("Menu Options: 0=contine, 1=lower bound, 2=upper bound, 3=step \n");
int option;
do {
printf ("Choose Option (0 to continue with set values): \n");
scanf ("%d", &option);
switch (option)
{
case 1: printf ("Enter lower bound: ");
break;
case 2: printf ("Enter upper bound: ");
break;
case 3: printf ("Enter step: ");
break;
case 0: printf ("\n");
break;
} while (option != 0); {
int c;
for (c = 10; c > 0; c++) {
printf ("%f", c);
fahrenheit = (celsius * SCALE_FACTOR) + FREEZING_PT;
kelvin = celsius + 273.15;
printf ("\n");
printf ("Today's date is: %d/%d/%d\n", m, d, y);
printf ("Celsius temperature: %.2f\n", celsius);
printf ("Fahrenheit temperature: %.2f\n", fahrenheit);
printf ("Kelvin temperature: %.2f\n", kelvin);
return 0;
}