Menampilkan Data Dengan Memasukan Nilay Array
Posted by Budi Arieyanto | Posted in Borlant C++ | Posted on 02.52
#include<iostream.h>
#include<conio.h>
int i,n,array[10];
void input (int jumlah)
{
for (i=1;i<=jumlah;i++)
{
cout<<"Masukkan array ke "<< i <<" adalah ";
cin>>array[i];
}
}
void tampil (int jumlah)
{
for (i=1;i<=jumlah;i++)
{
cout<<"Data array ke "<< i <<" adalah "<<array[i]<<"\n";
}
}
void main()
{
cout<<"masukkan jumlah data = ";
cin>>n;
cout<<"\nPROSEDUR INPUTAN DATA \n \n";
input(n); //pemanggilan prosedur
cout<<"\nPROSEDUR TAMPILAN DATA \n \n";
tampil(n); //pemanggilan prosedur
getch();
}


Comments (0)
Posting Komentar