Posted by : Unknown Friday, December 15, 2017

haloo sobat TI! kali ini saya akan membahas program penjumlahan dan perkalian dengan dev c++

langsung saja check it source code

#include <iostream>
#include <conio.h>
using namespace std;

int tambah (int a,int b)
{
int x;
x=a+b;
return x;
}

int kali (int a,int b){
int y;
for (int i=1; i<=b; i++) {
y=y+a;
}
return y;
}
int main ()
{
int a,b,x,y;
cout<<"Program Penjumlahan dan perkalian (hanya menggunakan operator +)"<<endl<<endl;
cout<<"nilai a : ";
cin>>a;
cout<<"nilai b : ";
cin>>b;
x=tambah(a,b);
cout<<"hasil tambah : "<<x<<endl;
y=kali(a,b);
cout<<"hasil kali : "<<y<<endl;

getch ();
}

Leave a Reply

sudah baca jangan lupa comment and like

Subscribe to Posts | Subscribe to Comments

program factorial bilangan dengan dev c++

#include <iostream> using namespace std; int main() { int b,c; cout<<“program oleh suparto”<<endl; cout<<“masukk...

- Copyright © mari kita berkembang😊 - Blogger Templates - Powered by Blogger - Designed by Johanes Djogan -