#include<constream.h>
void main()
{
int a[5];
int x,y;
y=1;
clrscr();
for (x=0;x<5;x++)
{
cout<<” Input Angka “<<” : “;cin>>x;
}
for (x=0;x<5;x++)
{
cout<<”\n Hasil : “;cout<<x;
}
getch();
}
Array 2 Dimensi
Berikut Source Code nya :
#include<constream.h>
void main()
{
int n[3][3], x,y;
clrscr();
for(x=0;x<=2;x++)
{
for(y=0;y<=2;y++)
{
cout<<"Masukkan angka pada baris ke "<<x<<" kolom ke "<<y<<" : ";
cin>>n[x][y];
}
cout<<endl;
}
for(x=0;x<=2;x++)
{
for(y=0;y<=2;y++)
{
cout<<n[x][y]<<" ";
}
cout<<endl;
}
getch();
}
kalo ponter to array gmna codingnya?
BalasHapuspointer mksdnya
BalasHapus