#include <iostream>
#include <string>
using namespace std;
class Bilangan{
private:
int a,b;
public:
Bilangan(){a=1;b=100;}
int rekursif(int a,int b);
void rekursif();
};
int Bilangan::rekursif(int a,int b){
if (a<=100){
if (a%5==0 && a%7==0){
cout<<"Hasilnya :"<<a<<endl;
}return rekursif(a+1,b);
}
}
int main()
{ Bilangan x;
x.rekursif(1,100);
system("PAUSE");
return 0;
}
Comments
Post a Comment