Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <conio.h>
- #include <iostream>
- using namespace std;
- struct mahasiswa
- {
- char nim[9];
- char nama [25];
- char alamat [40];
- short umur;
- };
- main ()
- {
- mahasiswa mhs;
- cout<<"NIM : ";
- cin.getline(mhs.nim,9);
- cout<<"Nama : ";
- cin.getline(mhs.nama,25);
- cout<<"Alamat : ";
- cin.getline(mhs.alamat,40);
- cout<<"Umur : ";
- cin>>mhs.umur;
- cout<<"\n\n\nNIM : "<<mhs.nim;
- cout<<"\nNama : "<<mhs.nama;
- cout<<"\nAlamat : "<<mhs.alamat;
- cout<<"\nUmur : "<<mhs.umur;
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement