Showing posts with label PRAKTIKUM. Show all posts
Showing posts with label PRAKTIKUM. Show all posts

praktikum alpro "Menentukan apakah bilangan tersebut persegi atau persegi panjang"

On Sunday, April 21, 2013 0 comments

Menentukan apakah bilangan tersebut persegi atau persegi panjang

 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;
}
Read more ...»