Total Penayangan

Buku Rujukan (ebook how to solve)

Ebook how to solve
4.1
#include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char** argv) {
int m,n,c,d,first[10][10],second[10][10],sum[10][10];
cout<<" masukan baris dan colom : \n";
cin>>m>>n;
cout<<"masukan angka : \n";
for(c=0;c<m;c++){
for(d=0;d<n;d++){
cin>>first[c][d];
}
cout<<endl;
}
cout<<" balikannya : \n";
for(c=0;c<m;c++){
for(d=0;d<n;d++){
cout<<first[d][c];
}
cout<<endl;
}

for(c=0;c<m;c++){
for(d=0;d<n;d++){
sum[c][d]=first[c][d]+first[d][c];
}
}
cout<<"jumlah\n";
for(c=0;c<m;c++){
for(d=0;d<n;d++){
cout<<sum[c][d]<<"\t";
cout<<endl;
}
}

    return 0;
}
No. 1
#include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char** argv) {
int m,n,c,d,first[10][10],second[10][10],sum[10][10];
cout<<" masukan baris dan colom : \n";
cin>>m>>n;
cout<<"masukan angka : \n";
for(c=0;c<m;c++){
for(d=0;d<n;d++){
cin>>first[c][d];
}
cout<<endl;
}
cout<<" balikannya : \n";
for(c=0;c<m;c++){
for(d=0;d<n;d++){
cout<<first[d][c];
}
cout<<endl;
}

for(c=0;c<m;c++){
for(d=0;d<n;d++){
sum[c][d]=first[c][d]+first[d][c];
}
}
cout<<"jumlah\n";
for(c=0;c<m;c++){
for(d=0;d<n;d++){
cout<<sum[c][d]<<"\t";
cout<<endl;
}
}

    return 0;
}

4.2

Algoritma

Deklarasi banyak,i,x
array int nilai [20]
Deklarasi string nama

inputkan banyak mahasiswa
for (int i=1;i<=banyak;i++){
input nama;
input nilai mahasiswa i
if (nilai[20]>=80 || nilai[20]<=100)
ceta nilai = A
else if (nilai[20]>=60 || nilai[20]<80)
cetak nilai = B
else if (nilai[20]>=40 || nilai[20]<60)
cetak nilai = C
else if (nilai[20]>=20 || nilai[20]<40)
cetak nilai = D
else if (nilai[20]>=0 || nilai[20]<20)
cetak nilai = E
end for


Program 


4.3
4.4
  
4.5

 No.5
 No.6
Share on Google Plus

About Unknown

Khoiriyatus.

0 comments:

Posting Komentar