#include <iostream> 
using namespace std; 
//Class is the combination of function & data members 
//Class are 3 types 
/* 
1 Private 
2 Public 
3 Protect 
If we write or not write Private this is By default 
like keywords 
Private is only accessable only in Class 
Private is accessable only by Public 
*/ 
class waqar { 
//there i write or not Private it means that there is private 
private: 
//declaration of data type or meber or data members 
// like 
int a; 
//to access int a; we Use Public 
public: 
//we can'nt use this type of sentance here 
// In class we can only use Function & data members 
//here you can write your own sentance 
//Like 
//cout<<"Enter your Roll Numbern"; 
//Here we Use cin keyword to get data from Keyboard 
//cin>>a; 
//Make your Function 
//Like 
int waqar1() 
//I make fuction Name of waqar1 
{ 
cout<<"Enter your roll Non"; 
cin>>a; 
} 
}; 
//Use main function 
main() 
{ 
//Here you can declare this class you can make 
waqar wq; 
//wq is called object 
//Calling of class you need object 
wq.waqar1(); 
//this is hole Program of using class 
}

Claas waqar

  • 1.
    #include <iostream> usingnamespace std; //Class is the combination of function & data members //Class are 3 types /* 1 Private 2 Public 3 Protect If we write or not write Private this is By default like keywords Private is only accessable only in Class Private is accessable only by Public */ class waqar { //there i write or not Private it means that there is private private: //declaration of data type or meber or data members // like int a; //to access int a; we Use Public public: //we can'nt use this type of sentance here // In class we can only use Function & data members //here you can write your own sentance //Like //cout<<"Enter your Roll Numbern"; //Here we Use cin keyword to get data from Keyboard //cin>>a; //Make your Function //Like int waqar1() //I make fuction Name of waqar1 { cout<<"Enter your roll Non"; cin>>a; } }; //Use main function main() { //Here you can declare this class you can make waqar wq; //wq is called object //Calling of class you need object wq.waqar1(); //this is hole Program of using class }