Question No. 7
7. You can convert temperature from degrees Celsius to degrees Fahrenheit by multiplying by 9/5
and adding 32. Write a program that allows the user to enter a floating-point number representing
degrees Celsius, and then displays the corresponding degrees Fahrenheit.
Anwer BY WAJID
#include
#include
void main(void)
{
float c_temp;
do{
cout<<"Enter the degrees Celsius\t\t\t\xdb "; cin >>c_temp;
cout<<"The corresponding degrees Fahrenheit is :\t\xdb "<<((9/5)*c_temp)+32<
cout<<"\n !Press c to continue or any key to exit."<
}while(getch()=='c');
}
and adding 32. Write a program that allows the user to enter a floating-point number representing
degrees Celsius, and then displays the corresponding degrees Fahrenheit.
Anwer BY WAJID
#include
#include
void main(void)
{
float c_temp;
do{
cout<<"Enter the degrees Celsius\t\t\t\xdb "; cin >>c_temp;
cout<<"The corresponding degrees Fahrenheit is :\t\xdb "<<((9/5)*c_temp)+32<
}
No comments:
Post a Comment