//Write a program to convert temp in celcius or forenheight.
#include<iostream.h>
#include<conio.h>
void main()
{
float c,f,f1,c1;
cout<<"Enter temp in celcius";
cin>>c;
cout<<"Enter temp in forenheight";
cin>>f;
f1=(c*18/10)+32;
c1=((f-32)/18)*10;
cout<<endl<<c<<" celcius temp in forenheight is "<<f1;
cout<<endl<<f<<" forenheight temp in celcius is "<<c1;
getch();
}
Output:
#include<iostream.h>
#include<conio.h>
void main()
{
float c,f,f1,c1;
cout<<"Enter temp in celcius";
cin>>c;
cout<<"Enter temp in forenheight";
cin>>f;
f1=(c*18/10)+32;
c1=((f-32)/18)*10;
cout<<endl<<c<<" celcius temp in forenheight is "<<f1;
cout<<endl<<f<<" forenheight temp in celcius is "<<c1;
getch();
}
Output:
No comments:
Post a Comment