#include<iostream.h>
#include<string.h>
typedef struct
{
int NRP;
char Nama[10];
char Semester[10];
char Jurusan[10];
}data;
data mhs[10];
main()
{
int *a;
int y;
mhs[1].NRP= 11038;
strcpy(mhs[1].Nama, "Wanto");
strcpy(mhs[1].Semester, " 2");
strcpy(mhs[1].Jurusan, " T I");
cout << " Silahkan Masukkan NRP = ";
cin >>y;
a=&y;
if (*a==mhs[1].NRP)
{
cout <<"\nData Mahasiswa\n\n NRP = " <<*a <<endl;
cout <<" Nama = " <<mhs[1].Nama<<endl;
cout <<" Semester = "<<mhs[1].Semester<<endl;
cout <<" Jurusan = "<<mhs[1].Jurusan<<endl;
}
else
{
cout << "Maaf, NRP belum terdaftar ";
}
}
Sabtu, 30 Maret 2013
Langganan:
Posting Komentar (Atom)
0 komentar:
Posting Komentar