#include <stdio.h>
#include <string.h>
#include <cs50.h>

int main(void)
{
    float C, F;
    
    const char *choice = GetString();
    
    if (!strcmp(choice, "F"))
    {
        F = C * 9 / 5 + 32;
        
        printf("Celsius:\n");
        printf("%f", C);
    }
    else
    {
        C = F / 9 * 5 + 32;
        
        printf("Fahrenheit:\n");
        printf("%f", F);
    }
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: