Created
April 23, 2017 18:55
-
-
Save patelmilanun/0c042c8f7734b41a9214df4a01011c03 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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