http://www.youtube.com/watch?v=QSRME4ezAxw&feature=youtu.be
Coding
7.2
|
Source
Code: 7.2
|
// Modul
7-2
//
Inisialisasi & PErubahan niai pada elemen Array
// Nama
: Wulan Kandiani Kusumah Wardani
//
NIM : 49013036
//
===============================================
#include
<iostream>
using
namespace std;
int main
()
{
int A[5] = { 10,20, 30, 40, 50};
cout << " Nilai awal pada
elemen Array :" << endl;
cout << " A [0] = "
<< A [0] << endl;
cout << " A [1] = "
<< A [1] << endl;
cout << " A [2] = "
<< A [2] << endl;
cout << " A [3] = "
<< A [3] << endl;
cout << " A [4] = "
<< A [4] << endl << endl;
// Perubahan nilai elemen 1 & 2
A [0] = 12;
A [1] = 25;
cout << "Setelah Perubahan
nilai Array :" << endl;
cout << "A [0] = "
<< A[0] << endl;
cout << "A [1] = "
<< A[1] << endl;
cout << "A [2] = "
<< A[2] << endl;
cout << "A [3] = "
<< A[3] << endl;
cout << "A [4] = "
<< A[4] << endl << endl;
system ("pause") ;
return 0;
}
|
Deskripsi
singkat:
|
Script
ini digunakan untuk menginputkan lalu menampilkan kembali, sama seperti yang
sebelum nya. Tapi proses yang ke dua untuk A[0] menjadi 12 dan A[1] menjadi
25
|
Tidak ada komentar:
Posting Komentar