#include <iostream>
#include <iomanip>
using namespace std;
void TempConversion(float *,float *);
int main()
{
float ct,ft=0.0;
cout<<"Enter temperature in Centigrade: ";
cin>>ct;
cout<<"Before conversion: "<<ct<<setw(5)<<ft<<endl;
TempConversion(&ct,&ft);
cout<<"After conversion: "<<ct<<setw(5)<<ft<<endl;
return 0;
}
void TempConversion(float *x,float *y)
{
*y=(9/5)*(*x)+32;
}
#include <iomanip>
using namespace std;
void TempConversion(float *,float *);
int main()
{
float ct,ft=0.0;
cout<<"Enter temperature in Centigrade: ";
cin>>ct;
cout<<"Before conversion: "<<ct<<setw(5)<<ft<<endl;
TempConversion(&ct,&ft);
cout<<"After conversion: "<<ct<<setw(5)<<ft<<endl;
return 0;
}
void TempConversion(float *x,float *y)
{
*y=(9/5)*(*x)+32;
}
No comments:
Post a Comment