Program to create a class and a single object and access class functions
#include <iostream> #include <stdio.h> using namespace std; class student { private: int rollno; char name[20]; int marks; float fee; public: void getdata() { cout<<“\nEnter Roll no : “; cin>>rollno; fflush(stdin); cout<<“Enter name : “; gets(name); cout<<“Enter Marks : “; cin>>marks; cout<<“Enter fee : “; cin>>fee; } void putdata() { cout<<“\nRollno is : “<<rollno; cout<<“\nName is …
Program to create a class and a single object and access class functions Read More »