create c++ programme to Converts the user's Celsius to Fahrenheit
Answers
Answered by
0
#include <iostream.h>
#include <iomanip.h>
void main()
{
float c_temp; // Holds user's Celsius temperature float f_
temp; // Holds converted temperature cout << "What is the Celsius temperature to convert ? ";
cin >> c_temp; f_temp = convert(c_temp);
// Convert the temperature cout << "The Fahrenheit equivalent is " << setprecision(1) << f_temp << "\n"; return 0;}
float convert(float c_temp)
// Return var and parameter are both float
{ float f_temp; f_temp = c_temp * (9.0 / 5.0) + 32.0;
return (f_temp);
getch
#include <iomanip.h>
void main()
{
float c_temp; // Holds user's Celsius temperature float f_
temp; // Holds converted temperature cout << "What is the Celsius temperature to convert ? ";
cin >> c_temp; f_temp = convert(c_temp);
// Convert the temperature cout << "The Fahrenheit equivalent is " << setprecision(1) << f_temp << "\n"; return 0;}
float convert(float c_temp)
// Return var and parameter are both float
{ float f_temp; f_temp = c_temp * (9.0 / 5.0) + 32.0;
return (f_temp);
getch
Answered by
0
#include
#include
void main()
{
float cel, far;
clrscr();
cout<<"Enter temp. in Celsius: ";
cin>>cel;
far = cel * 9/5 + 32;
cout<<"Temp. in Fahrenheit: "< getch();
}
Hope it helped
#include
void main()
{
float cel, far;
clrscr();
cout<<"Enter temp. in Celsius: ";
cin>>cel;
far = cel * 9/5 + 32;
cout<<"Temp. in Fahrenheit: "< getch();
}
Hope it helped
Similar questions