Friday, May 3, 2013

Menampilkan Nilai Pada Array

Source Code :

#include <cstdlib>
#include <iostream>
using namespace std;

int main()
{
// Mendeklarasikan array A dengan 5 buah elemen bertipe int
int A[5];
// Mengisikan nilai ke dalam elemen array
cout<<"Masukan nilai yang anda diinginkan"<<endl;
for (int C=0; C<5; C++){
cout<<"A["<<C<<"] = "; cin>>A[C];
}
cout<<'n';
// Menampilkan nilai yang terdapat dalam elemen array
cout<<"Menampilkan nilai yang telah dimasukan"<<endl;
for (int J=0; J<5; J++){
cout<<"Nilai yang terdapat pada elemen ke-";
cout<<J<<" : "<<A[J]<<endl;
}

system("PAUSE");
return EXIT_SUCCESS;
}

Outputnya :


1 comments:

The King Casino: The New King & The World of Gaming
The King Casino is the new febcasino.com place https://jancasino.com/review/merit-casino/ where the real money gambling is legal in Florida septcasino and Pennsylvania. We love the worrione new casino. We've got some 1xbet app great

Post a Comment