Write a C C++ program to convert from Celsius to Fahrenheit

Write a C C++ program to convert from Celsius to Fahrenheit

C Language के बारे में अधिक जानने के लिए देखें—Brief Introduction of C

C Language की विशेषताओं एवं शक्तियों को जानने के लिए देखें—Features and Powers of C

Flowchart to convert from Celsius to Fahrenheit

Centigrade to Fahrenheit conversion flowchart

C program to convert from Celsius to Fahrenheit

#include<stdio.h>
int main()
{
    float c,f;
    printf("Enter temperature in celsius: ");
    scanf("%f",&c);
    f = 32+(c*9)/5;
    printf("Temperature in fahrenheit = %f",f);
    return 0;
}

C++ program to convert from Celsius to Fahrenheit

#include<iostream>
using namespace std;
int main()
{
    float c,f;
    cout<<"Enter temperature in celsius: ";
    cin>>c;
    f = 32+(c*9)/5;
    cout<<"Temperature in fahrenheit = "<<f;
    return 0;
}

Output of C C++ program to convert from Celsius to Fahrenheit

Enter temperature in celsius: 37
Temperature in fahrenheit = 98.599998
Enter temperature in celsius: 50
Temperature in fahrenheit = 122.000000

Other related C C++ programs

  1. Sum of two entered numbers
  2. Average of three entered numbers
  3. Simple interest
  4. Total and Percent
  5. Swapping values of two variables
  6. Swapping without using third variable
  7. Find area and circumference of circle
Share it to:

Published by

admin

I am a computer teacher, programmer and web developer