Algoritma
1. Analisisnya :
Membuat Tabel perkalian
2.
Identifikasinya :
Input :
-
Output :
Tabel perkalian
C++ nya
#include <cstdlib>
#include <iostream>
#include <iomanip>
using namespace std;
int garis(int g)
{
int m;
for (m=1;m<=g;m++)
cout<<"=";
cout<<endl;
return m;
}
int main(int argc, char *argv[])
{
cout<<" TABEL PERKALIAN"<<endl;
cout<<endl;
int a,b;
garis(30);
for(a=1;a<=5;a++)
{
cout<<endl;
for(b=1;b<=5;b++)
cout<<setw(3)<<a*b<<setw(3)<<"|";
cout<<endl;
garis(30);
}
cout<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}
#include <iostream>
#include <iomanip>
using namespace std;
int garis(int g)
{
int m;
for (m=1;m<=g;m++)
cout<<"=";
cout<<endl;
return m;
}
int main(int argc, char *argv[])
{
cout<<" TABEL PERKALIAN"<<endl;
cout<<endl;
int a,b;
garis(30);
for(a=1;a<=5;a++)
{
cout<<endl;
for(b=1;b<=5;b++)
cout<<setw(3)<<a*b<<setw(3)<<"|";
cout<<endl;
garis(30);
}
cout<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}
#Screenshotnya :
Tidak ada komentar:
Posting Komentar