Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
MY FIRST OBJECT ORIENTED PROGRAM
//clang 3.8.0 #include <iostream> using namespace std; class stud { public: char name[30],clas[10]; int rol,age; void enter() { cout<<"Enter Student Name: "; cin>>name; cout<<"Enter Student Age: "; cin>>age; cout<<"Enter Student Roll number: "; cin>>rol; cout<<"Enter Student Class: "; cin>>clas; } void display() { cout<<"\n Age\tName\tR.No.\tClass"; cout<<"\n"<<age<<"\t"<<name<<"\t"<<rol<<"\t"<<clas; } }; int main() { class stud s; s.enter(); s.display(); cin.get();//use this to wait for a keypress }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Throttle Example in C++
enum operator
Dash-D compiler flag example
Pointer array
C++ Template
mddd
NaN inside set
marquee text in C++
is_convertible
user defined exception
Please log in to post a comment.