C Program To Convert Temperature From Celsius To Fahrenheit And Fahrenheit To Celsius

आज हम सी लैंग्वेज का उपयोग करते हुए दो प्रोग्राम बनायेगे पहले प्रोग्राम में हम Celsius को Fahrenheit में Convert करेंगे और दूसरे प्रोग्राम में हम Fahrenheit को Celsius में Convert करेंगे | मगर सबसे पहले हम ये जान लेते है की सेल्सियस और फ़ारेनहाइट क्या है और इसका फार्मूला क्या है |

Introduction about celsius and Fahrenheit

Celsius और Fahrenheit टेम्प्रेचर को मापने का एक तरीका है Celsius को oC से रिप्रेजेंट किया जाता है और Fahrenheit को से oF से रिप्रेजेंट किया जाता है |

Celsius को Fahrenheit में Convert करने के लिए एक फार्मूला होता है जिसका उपयोग कर हम Celsius को Fahrenheit में कन्वर्ट कर पाएंगे | ठीक इसी तरह Fahrenheit को Celsius में Convert करने के लिए भी एक फार्मूला होता है जिसका उपयोग कर हम Fahrenheit को Celsius में कन्वर्ट कर पाएंगे |

Formula to Convert Temperature From Celsius To Fahrenheit

fahrenheit = (celsius * 1.8) + 32

Formula to Convert Temperature From Fahrenheit to Celsius

Celsius = ((Fahrenheit-32)*5)/9;

आइये अब इन्ही Formulas का उपयोग करके की लैंग्वेज में एक प्रोग्राम बनाते है जिसके माध्यम से हम ये काम करेंगे |

Write A C Program To Convert Temperature From Celsius To Fahrenheit

Algorithm-:

  1. Program Start
  2. Declaration of variable
  3. Enter temperature in Celsius
  4. Fahrenheit conversion formula
  5. Print result
  6. Program End

Flowchart

C Program To Convert Temperature From Celsius To Fahrenheit

Coding For Program To Convert Temperature From Celsius To Fahrenheit

#include<stdio.h>
#include<conio.h>
void main()
{
  float c, f;
  printf("Enter the centigrade\n");
  scanf("%f",&c);
  f=(c*9/5)+32;
  printf("Temperature in Fahrenheit is : %f",f);
  getch();
}

Output -:

Enter the centigrade
37
Temperature in Fahrenheit is : 98.599998

Write A C Program to Convert Temperature From Fahrenheit to Celsius

#include<stdio.h>
#include<conio.h>
void main()
{
  float c, f;
  printf("Enter the Fahrenheit");
  scanf("%f",&f);
  c = ((f-32)*5)/9;
  printf("Temperature in Celsius is %f",c);
  getch();
}

Output -:

Enter the Fahrenheit
98.599998
Temperature in Celsius is : 37.000000

C Programming Exercises With Solutions (PDF)

Leave a Reply

Your email address will not be published. Required fields are marked *