Private:
#include
class CONTOH{
int X; //X bersifat private
public:
void SetX(int XX){
X=XX;
}
void ShowX(){
cout<<”Nilai X :”<<
class CONTOH{
int X;
public:
void SetX(int XX){
X=XX;
}
int KuadratX ( ){
return X*X;
}
// ...
};
//Fungsi utama
int main(){
#include
class CONTOH{
int X; //X bersifat private
public:
void SetX(int XX){
X=XX;
}
void ShowX(){
cout<<”Nilai X :”<
class CONTOH{
int X;
public:
void SetX(int XX){
X=XX;
}
int KuadratX ( ){
return X*X;
}
// ...
};
//Fungsi utama
int main(){
0 comments:
Post a Comment