Assalamualaikum wr.wb
Latihan halaman 161
Algoritma sebagai berikut :
Latihan halaman 161
Algoritma sebagai berikut :
AlgoritmaDeklarasi Subprogram
c,i,j,kali,proses,masuk,hasil=integer
Deskripsi
Void masuk(c[20],b[20])
For(i=1;j<=2;i++) then
For(j=1;j<=3;j++)then
Write(“Vaktor A”)
Write(“Vaktor B”)
Void proses(c[20],b[20])
Write(“Vaktor A”)
For(i=1;j<=2;i++) then
For(j=1;j<=3;j++)then
Write(b)
Write(“Vaktor B”)
For(i=1;j<=2;i++) then
For(j=1;j<=3;j++)then
Write(c)
Write(“Vaktor C”)
For(i=1;j<=2;i++) then
For(j=1;j<=3;j++)then
Hasil<-b+c
Write(hasil)
Write(“Vaktor Hasil Kali”)
For(i=1;j<=2;i++) then
For(j=1;j<=3;j++)then
Kali<-b*hasil
Write(Kali)
Write(“Banyak Elemen”)
Int main()
Write(“Menghitung Vaktor”)
Masuk(b,c)
Proses(b,c,hasil,kali)
Return 0
c,i,j,kali,proses,masuk,hasil=integer
Deskripsi
Void masuk(c[20],b[20])
For(i=1;j<=2;i++) then
For(j=1;j<=3;j++)then
Write(“Vaktor A”)
Write(“Vaktor B”)
Void proses(c[20],b[20])
Write(“Vaktor A”)
For(i=1;j<=2;i++) then
For(j=1;j<=3;j++)then
Write(b)
Write(“Vaktor B”)
For(i=1;j<=2;i++) then
For(j=1;j<=3;j++)then
Write(c)
Write(“Vaktor C”)
For(i=1;j<=2;i++) then
For(j=1;j<=3;j++)then
Hasil<-b+c
Write(hasil)
Write(“Vaktor Hasil Kali”)
For(i=1;j<=2;i++) then
For(j=1;j<=3;j++)then
Kali<-b*hasil
Write(Kali)
Write(“Banyak Elemen”)
Int main()
Write(“Menghitung Vaktor”)
Masuk(b,c)
Proses(b,c,hasil,kali)
Return 0
Berikut Hasil Program nya:
0 komentar:
Posting Komentar