C Online Compiler
Example: C Program to Convert Celsius to Fahrenheit using While loop
C
C++
C#
Java
Python
PHP
main.c
STDIN
Run
// C Program to Convert Celsius to Fahrenheit using While loop #include <stdio.h> int main() { float c, f; int i = 1; // c - To store the celsius // f - To store the fahrenheit while (i) { printf("Enter the temperature in Celsius::\n"); scanf("%f", &c); /* celsius to fahrenheit conversion formula */ f = (c * 9 / 5) + 32; // Final Output printf("\n%f Celsius = %f Fahrenheit\n", c, f); i--; } return 0; }
23
Output
Clear
ADVERTISEMENTS