Friday, 22 April 2011

contoh program struct mahasiswa di C++


struct mahasiswa
    char nim[15];
    char nama[30];
    char alamat[50];
    float ipk;


void main()
    mahasiswa mhs;
   cout<<"program struct"<<endl<<endl;
   gotoxy(4,3);cout<<"NIM       :";gotoxy(20,3); cin.getline(mhs.nim,15);
   gotoxy(4,4);cout<<"Nama      :";gotoxy(20,4); cin.getline(mhs.nama,30);
   gotoxy(4,5);cout<<"Alamat    :";gotoxy(20,5); cin.getline(mhs.alamat,50);
   gotoxy(4,6);cout<<"Nilai IPK :";gotoxy(20,6); cin>>mhs.ipk;

   //yg diinputkan user
   gotoxy(4,8);cout<<"Nim Anda       : ";gotoxy(25,8);cout<<mhs.nim<<endl;
   gotoxy(4,9);cout<<"Nama Anda      : ";gotoxy(25,9);cout<<mhs.nama<<endl;
   gotoxy(4,10);cout<<"Alamat Anda    : ";gotoxy(25,10);cout<<mhs.alamat<<endl;
   gotoxy(4,11);cout<<"Nilai IPK Anda : ";gotoxy(25,11);cout<<mhs.ipk<<endl;


1 comment:

  1. I was beginning tо doubt that it was possible to fіnd decent сontent
    for once, I was getting tired of thе сοnstant drivel I finԁ daily, you dеserve respeсt fοr рosting
    reаdable and іnfоrmative data.
    Also see my webpage > height increasing shoes


Komentar sobat akan saya hapus jika:

- Mengandung unsur SPAM
- LINK hidup
- tidak sesuai dengan topik

jika ingin menyisipkan LINK ,silahkan pilih Name/URL pada option profil !