tubeshowcase●1,116,245 videos♡ My collection 0
← Learn to Code

Learn to Code07:51

Let's code a temperature program with C programming! 🌡️

Bro Code ↗

From the creator

#coding #programming #cprogramming // TEMPERATURE CONVERSION PROGRAM char choice = '\0'; float fahrenheit = 0.0f; float celsius = 0.0f; printf("Temperature Conversion Program\n"); printf("C. Celsius to Fahrenheit\n"); printf("F. Fahrenheit to Celsius\n"); printf("Is the temp in Celsius (C) or Fahrenheit (F)?: "); scanf("%c", &choice); if(choice == 'C'){ printf("Enter the temperature in Celsius: "); scanf("%f", &celsius); fahrenheit = (celsius * 9 / 5) + 32; // C to F printf("%.1f Celsius is equal to %.1f Fahrenheit\n", celsius, fahrenheit); } else if(choice == 'F'){ printf("Enter the temperature in Fahrenheit: "); scanf("%f", &fahrenheit); celsius = (fahrenheit - 32) * 5 / 9; printf("%.1f Fahrenheit is equal to %.1f Celsius\n", fahrenheit, celsius); } else{ printf("Invalid choice! Please select C or F\n"); } return 0;

Published 2025-03-05 · Watch on YouTube ↗
Availability and playback restrictions are controlled by the original channel.

Keep exploring Learn to Code