#include <conio.h> #include <iostream.h> class data { public: int a,b; public: data(); void tukar(); void cetak(); int maks2(int a, int b); void jalankan(); }; data::data(){ a=100; b=50; } int data::maks2(int a,int b){ if(a>b)return(a); else return (b); } main(){ data angka; angka.jalankan(); } void data ::jalankan(){ cout<<"masukkan dua bil integer"<<endl; cout<<"masukkan bil pertama :"; cin>>a; cout<<"masukkan bil kedua:"; cin>>b; cout<<"nilai terbesar: "<<maks2(a,b); getch(); }
No comments:
Post a Comment