Posted by Belajar Pemrograman
Friday, November 23, 2012
Contoh pemrograman bahasa c++ menggunakan 2 class
Input :
#include<iostream>
using namespace std;
class display
{
private:
int x;
float z;
public:
void pemrograman()
{
cout<<"Welcome to Belajar Pemrograman"<<endl;
cout<<"==============================="<<endl;
cout<<"http://belprog.blogspot.com"<<endl;
}
} ;
class b
{
public:
int x;
};
void belajarpemrograman()
{
display belprog;
belprog.pemrograman();
}
int main()
{
display bel;
b BELPROG;
belajarpemrograman();
BELPROG.x;
system("pause");
}
Output :