#include<conio.h>
#include<iostream.h>
void main()
{
clrscr();
float num1,num2;
cout<<"Enter Fahrenheit Temperature\n" ;
cin>>num1;
num2=5/9*(num1-32);
cout<<"\nCentigrade Temperature " <<num2;
}
NOTE::
This Program happily gets compiled and runs. However ,it gives '0' as the output for any value.The reason is the value of 5/9 is '0' and '0*something ' is always '0'.
#include<conio.h>
#include<iostream.h>
void main()
{
clrscr();
float num1,num2,num3;
cout<<"\nEnter Centigrade Temperature ";
cin>>num1;
num2=((9/5)*num1)+32;
num3=(1.8*num1)+32;
cout<<"\nThe Fahrenheit Temperature is "<<num2<<" "<<num3;
}
OUTPUT::
Enter Centigrade Temperatur ::25
The Fahrenheit Temperature is 57 77.
#include<iostream.h>
void main()
{
clrscr();
float num1,num2;
cout<<"Enter Fahrenheit Temperature\n" ;
cin>>num1;
num2=5/9*(num1-32);
cout<<"\nCentigrade Temperature " <<num2;
}
NOTE::
This Program happily gets compiled and runs. However ,it gives '0' as the output for any value.The reason is the value of 5/9 is '0' and '0*something ' is always '0'.
#include<conio.h>
#include<iostream.h>
void main()
{
clrscr();
float num1,num2,num3;
cout<<"\nEnter Centigrade Temperature ";
cin>>num1;
num2=((9/5)*num1)+32;
num3=(1.8*num1)+32;
cout<<"\nThe Fahrenheit Temperature is "<<num2<<" "<<num3;
}
OUTPUT::
Enter Centigrade Temperatur ::25
The Fahrenheit Temperature is 57 77.
No comments:
Post a Comment