input A=6, B=4
C++
#include <iostream>
#include <conio.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
class A {
public :
void input ();
void proses ();
void output ();
private :
int A, B;
};
void A:: input (){
cout<<"masukan nilai A"<<endl;
cin>>A;
cout<<"masukan nilai B"<<endl;
cin>>B;
}
void A:: proses (){
if (A==B)
cout<<"bilangan persegi"<<endl;
else
cout<<"bilangan persegi panjang"<<endl;
}
int main(int argc, char *argv[]) {
A run;
run.input();
run.proses();
return 0;
}
0 komentar