Skip to content

Instantly share code, notes, and snippets.

@krishanthecoder
Created February 6, 2025 11:49
Show Gist options
  • Save krishanthecoder/aaee7de95854de82cd0d28e69c00d4a0 to your computer and use it in GitHub Desktop.
Save krishanthecoder/aaee7de95854de82cd0d28e69c00d4a0 to your computer and use it in GitHub Desktop.
Convert Fahrenheit to Celsius using for loop in c
#include <stdio.h>
int main(void)
{
printf("Fahrenheit \t Celsius\n");
int fahr = 300;
for (; fahr >= 0; fahr -= 20)
{
printf("%6d %16.1f\n", fahr, (5.0 / 9.0) * (fahr - 32));
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment