-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCODE14TR.cpp
More file actions
32 lines (28 loc) · 785 Bytes
/
CODE14TR.cpp
File metadata and controls
32 lines (28 loc) · 785 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include<iostream>
using namespace std;
class employs
{
private:
/* data */
int salaries;
public:
int DOB; // int DOB; <----------public data here
void pridata(int salary); //void pridata(int salaries); <----function prototype here
void pubdata()
{ //<-------we SHOULD give function in VOID not int, float this is cout data function
cout<<"data of birth is "<<DOB<<endl;
cout<<"your salary is "<<salaries<<endl;
}
};
void employs::pridata(int salary) //<------------this is function in which we give private data prototype in uper
{
salaries=salary;
}
int main()
{
employs hariom;
hariom.DOB=18;
hariom.pridata(100000);
hariom.pubdata();
return 0;
}