#include
<cstdlib>
#include
<iostream>
using
namespace std;
struct
mahasiswa{
char nama[30];
int nim;
};
int
main(int argc, char *argv[])
{
mahasiswa a[5];
for(int i=0;i<5;i++){
cout<<"Masukkan NIM:
";
cin>>a[i].nim;
cout<<"masukkan Nama:
";
cin>>a[i].nama;
}
for(int i=0;i<5;i++){
cout<<"NIM Mahasiswa:
";
cout<<a[i].nim<<endl;
cout<<"Nama Mahasiswa:
";
cout<<a[i].nama<<endl;
}
/*a.nama="agus";
a.nim=98;
cout<<"Nim Mahasiswa :
"<<a.nim<<endl;
cout<<"Nama Mahasiswa :
"<<a.nama<<endl;
*/
system("PAUSE");
return EXIT_SUCCESS;
}
Tidak ada komentar:
Posting Komentar