Listing Program:
#include
void satu()
{
cout<<"1x1 = 1"<
cout<<"1x2 = 2"<
cout<<"1x3 = 3"<
cout<<"1x4 = 4"<
cout<<"1x5 = 5"<
cout<<"1x6 = 6"<
cout<<"1x7 = 7"<
cout<<"1x8 = 8"<
cout<<"1x9 = 9"<
cout<<"1x10 = 10"<
};
void dua()
{
cout<< "2x1 =2"<
cout<< "2x2 =4"<
cout<< "2x3 =6"<
cout<< "2x4 =8"<
cout<< "2x5 =10"<
cout<< "2x6 =12"<
cout<< "2x7 =14"<
cout<< "2x8 =16"<
cout<< "2x9 =18"<
cout<< "2x10=20"<
};
void tiga()
{
cout<<"3x1 =3"<
cout<<"3x2 =6"<
cout<<"3x3 =9"<
cout<<"3x4 =12"<
cout<<"3x5 =15"<
cout<<"3x6 =18"<
cout<<"3x7 =21"<
cout<<"3x8 =24"<
cout<<"3x9 =27"<
cout<<"3x10=30"<
};
void main()
{
int n;
cout<<"Input banyaknya bilangan yang akan dijadikan perkalian: "; cin>>n;
do
{
cout<<"Hasil: "<<"\n";
if (n == 1)
satu();
if (n==2)
{
satu();cout<
dua();
};
if (n==3)
{
satu();cout<
dua();cout<
tiga();
};
cout<
cout<<"Input banyaknya bilangan yang akan dijasikan perkalian: "; cin>>n;
}
while(n<=10);
if (n>10)
{
cout<<"Perkalian Hanya 1 - 10, Silahkan Input banyaknya bilangan kembali"<<"\n";
cout<
cout<<"Input banyaknya bilangan yang akan dijasikan perkalian: "; cin>>n;
};
return; }
Print Out:
Silahkan Berkomentar Pada Form Komentar dengan sopan dan santun .. No Spam .... !!! thank's @Admin
EmoticonEmoticon