Program 1 Matematika diskrit

#include <cstdlib>
#include <iostream>
#include <conio.h>

using namespace std;

int main()
{
 string a [] = {"changmin","jaejoong"};
 string b [] = {"f8291","n4810","b0637"};

 int c [] = {2,3,4};
 int d [] = {2,4,8,10,12};

 cout<<"Hasil Penggabungan a dan b : "<<endl;
 cout<<"{ "<<endl;
 for(int i=0; i<2;){
 for (int j=0; j<3; j++){
 cout<<" ("<<a[i] <<" , " <<b[j]<< ") ";
 }
 i++;
 }
 cout<<endl;
 cout<<"}"<<endl;
 cout<<endl;

 cout<<" Hasil himpunan c habis membagi d : "<<endl;
 cout<<"{"<<endl;
 for(int k=0; k<3;){
 for(int l=0; l<5; l++){
 if(d[l] % c[k] ==0){
 cout<<" ("<<c[k] <<"," <<d[l]<< ") ";
 }
 k++;
 }
 cout<<endl;
 cout<<"}"<<endl;
 }

 getch();
}

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s