Posted by MindBreaker at 2:15 AM
Read our previous post
Object:
Convert celcius temperature into Frenhiet
Source Code:
#include <iostream>
using namespace std;
class
convert
{
public:
int frenhiet(int cel)
{
int fren;
fren=(cel*9/5)+32;
return fren;
}
};
void
main()
{
convert con;
int
cel,frenhiet,ans;
cout<<"Enter
Temperature in Celcius"<<endl;
cin>>cel;
ans=con.frenhiet(cel);
cout<<"TEmperature
in frenhiet : "<<ans<<endl;
}
Output:
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.