Stack Input Output
#include<iostream.h>
#include<conio.h>
main(){
int nilai[2];
cout<<"menyimpan inputan user"<<endl;
cout<<"----------------------"<<endl;
for (int i=0;i<2;i++)
{
cout<<"Masukkan nilai ke-"<<i<<": ";
cin>>nilai[i];
}
cout<<endl;
cout<<"menampilkan inputan user"<<endl;
cout<<"------------------------"<<endl;
for (int i=0;i<2;i++)
{
cout<<"nilai ke-"<<i<<" : ";
cout<<nilai[i]<<endl;
}
getch();
}
Comments
Post a Comment