Skip to content

Instantly share code, notes, and snippets.

@patelmilanun
Created April 23, 2017 18:55
Show Gist options
  • Save patelmilanun/0c042c8f7734b41a9214df4a01011c03 to your computer and use it in GitHub Desktop.
Save patelmilanun/0c042c8f7734b41a9214df4a01011c03 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
class coordinate
{
private:
int feet,inch;
public:
coordinate(int a,int b)
{
feet=a;
inch=b;
}
operator float()
{
float meter=0;
meter=(feet*0.3048)+(inch*0.0254);
return meter;
}
};
int main() {
// your code goes here
coordinate c(5,5);
float meter=c;
cout<<"The meter is:"<<meter;
return 0;
}
===============output==============
The meter is:1.651
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment