Penjumlahan Array

#‎include ‬<iostream>
#include <conio.h>
using namespace std;
main()
{
int nilai [3]={1,2,3};
int n;
int jumlah=0;

for (n=0; n♥; n++)
{
jumlah=jumlah+nilai[n];
cout<< nilai [n]<<" ";

}
cout<<"Hasil Jumlah =";
cout<<jumlah;
getch();
}

Post a Comment

0 Comments