Contoh Program C++ Array Dimensi 1 Menginputkan
Ini Contoh Programnya :
#include<iostream.h>
void main ( )
{
int a[5];
cout<<"====================="<<endl;
cout<<"Masukan Inputan Data = "<<endl;
cout<<"input data-1 = ";
cin>>a[0];
cout<<"input data-2 = ";
cin>>a[1];
cout<<"input data-3 = ";
cin>>a[2];
cout<<"input data-4 = ";
cin>>a[3];
cout<<"input data-5 = ";
cin>>a[4];
cout<<"====================="<<endl;
cout<<"Tampilkan Hasil Inputan"<<endl;
cout<<a[0]<<" ";
cout<<a[1]<<" ";
cout<<a[2]<<" ";
cout<<a[3]<<" ";
cout<<a[4]<<" ";
}
Comments
Post a Comment