Write a program in C++ to create a class, get the value and print it
#include<iostream.h>
class member { private: int n; public: void setn() { cout <<"enter the value of n"<<endl; cin >> n; } void display() { cout << "entered value of n is : "<<n; } }; void main() { member o1; o1.setn(); o1.display(); } |