CLASSES CREATION

 #include <iostream>

using namespace std;

class sample  

//class creation

{

public:

static int a;

// datatype


static void data()

{

cout<<"i am the best";

}

//function



};

int sample::a=10;

//declaring datatype



int main()

{

cout<<sample::a<<"\n";   //printing data

sample::data();    //printing function without return type

return 0;

}


Comments

Popular posts from this blog

LIST ADT USING LINKED LIST

SORTING PROGRAM