Created
March 10, 2016 12:10
-
-
Save bilalmehrban/e1c288f6a0fc82ea85a3 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 temp | |
{ | |
private: | |
int data1; | |
float data2; | |
public: | |
void int_data(int d){ | |
data1=d; | |
cout<<"Number: "<<data1; | |
} | |
float float_data(){ | |
cout<<"\nEnter data: "; | |
cin>>data2; | |
return data2; | |
} | |
}; | |
int main(){ | |
temp obj1, obj2; | |
obj1.int_data(12); | |
cout<<"You entered "<<obj2.float_data(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment