#include <iostream>
using namespace std;
struct hitung {
int awal [3];
int akhir [3];
}calc;
int n,array_length, result=0;
int main ()
{
array_length = 3;
for ( n=0; n<array_length; n++ ){
cout<<n+1<<". input awal = ";
cin>>calc.awal[n];
cout<<"input akhir = ";
cin>>calc.akhir[n];
}
cout<<"\nResult : \n";
for ( n=0; n<array_length; n++ ) {
result = calc.awal[n] * calc.akhir[n];
cout << calc.awal[n] <<" * "<<calc.akhir[n] <<" = "<< result<<"\n";
}
return 0;
}
using namespace std;
struct hitung {
int awal [3];
int akhir [3];
}calc;
int n,array_length, result=0;
int main ()
{
array_length = 3;
for ( n=0; n<array_length; n++ ){
cout<<n+1<<". input awal = ";
cin>>calc.awal[n];
cout<<"input akhir = ";
cin>>calc.akhir[n];
}
cout<<"\nResult : \n";
for ( n=0; n<array_length; n++ ) {
result = calc.awal[n] * calc.akhir[n];
cout << calc.awal[n] <<" * "<<calc.akhir[n] <<" = "<< result<<"\n";
}
return 0;
}
Berikut Screenshot atau hasil source code yang di jalankan ;
Terima Kasih Semoga bisa membantu ...
mantap gan lanjut terus...
BalasHapus