Convert Celsius to Fahrenheit and Back Using Switch Statement in C
This program converts a given temperature from Celsius to Fahrenheit or Fahrenheit to Celsius, based on the user’s choice, using a switch statement. C Program #include <stdio.h> int main() { int choice; float temp, result; printf(“1. Celsius to Fahrenheit\n2. Fahrenheit to Celsius\n”); printf(“Enter your choice: “); scanf(“%d”, &choice); printf(“Enter temperature: “); scanf(“%f”, &temp); switch (choice) … Read more