C++ program that converts Celsius into Fahrenheit.

Q19. Write a C++ program that reads temperature in Celsius and displays it in Fahrenheit.

Ans.

#include<iostream.h>

#include<conio.h>   //for clrscr()

void main()

{

float Celsius, Fahrenheit;

clrscr();    //for clear screen

cout<<“\n Enter a temperature in Celsius: “;

cin>>Celsius;

Fahrenheit = Celsius * 9/5 + 32;

cout<<“\n The temperature in Fahrenheit is: “<<Fahrenheit;

}

Output

Enter a temperature in Celsius: 34.6

The temperature in Fahrenheit is: 94.279999

Leave a Reply

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

113 Views
%d bloggers like this: