#include <iostream>
#include <math.h>
using namespace std;
int kali(int m, int n)
{ int i, hasil=0;
for (i=1; i<=abs(4); i++)
hasil += m;
if (n<0) return(-hasil); else return(hasil);
}
main() {
int a, b;
cout << "Masukkan bilangan : "; cin >> a;
cout << "Akan dikali dengan : "; cin >> b;
cout << "Nilai " << a << " x " << b << " = " << kali(a,b);
return 0;
}
Program raptornya
#include <math.h>
using namespace std;
int kali(int m, int n)
{ int i, hasil=0;
for (i=1; i<=abs(4); i++)
hasil += m;
if (n<0) return(-hasil); else return(hasil);
}
main() {
int a, b;
cout << "Masukkan bilangan : "; cin >> a;
cout << "Akan dikali dengan : "; cin >> b;
cout << "Nilai " << a << " x " << b << " = " << kali(a,b);
return 0;
}
Program raptornya
Comments
Post a Comment