Skip to content

Instantly share code, notes, and snippets.

@bilalmehrban
Created March 10, 2016 12:10
Show Gist options
  • Save bilalmehrban/e1c288f6a0fc82ea85a3 to your computer and use it in GitHub Desktop.
Save bilalmehrban/e1c288f6a0fc82ea85a3 to your computer and use it in GitHub Desktop.
#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