#include<stdio.h>
main () {
int i, j;
int angka1[5];
int angka2[5];
int jml[5];
for (i=0; i<5; i++) {
printf("masukkan elemen array ke a %d : ",i);
scanf ("%d", &angka1[i]); }
for (i=0; i<5; i++) {
printf("%d\n", angka1[i]); }
for (i=0; i<5; i++) {
printf("masukkan elemen array b ke %d : ",i);
scanf ("%d", &angka2[i]); }
for (i=0; i<5; i++) {
printf("%d\n", angka2[i]); }
for (i=0; i<5; i++){
jml[i]=angka1[i]+angka2[i];
printf("hasil jumlah elemen a dan b : %d\n",jml[i]); }
}
main () {
int i, j;
int angka1[5];
int angka2[5];
int jml[5];
for (i=0; i<5; i++) {
printf("masukkan elemen array ke a %d : ",i);
scanf ("%d", &angka1[i]); }
for (i=0; i<5; i++) {
printf("%d\n", angka1[i]); }
for (i=0; i<5; i++) {
printf("masukkan elemen array b ke %d : ",i);
scanf ("%d", &angka2[i]); }
for (i=0; i<5; i++) {
printf("%d\n", angka2[i]); }
for (i=0; i<5; i++){
jml[i]=angka1[i]+angka2[i];
printf("hasil jumlah elemen a dan b : %d\n",jml[i]); }
}
No comments:
Post a Comment