Advertisement
JUN7

Mahasiswa menggunakan for (progam arjun ganteng)

Nov 11th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.46 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct mhs{
  5.     char nama[30];
  6.     char nim[11];
  7.     char alamat[50];
  8.     char prodi [18];
  9.     char tanggal [8];
  10. };
  11.  
  12. main(){
  13.     mhs m[10];
  14.     cout<<"  ==================================================="<<endl;
  15.     cout<<"  ================= BIODATA MAHASISWA ==============="<<endl;
  16.     cout<<"  ==================================================="<<endl;
  17.     cout<<"  ==================================================="<<endl;
  18.     for (int i=0; i<10; i++){
  19.         cout<<"Masukkan Nama : ";
  20.         cin>>m[i].nama;
  21.    
  22.         cout<<"Masukkan Nim : ";
  23.         cin>>m[i].nim;
  24.  
  25.         cout<<"Masukan Tanggal Lahir : ";
  26.         cin>>m[i].tanggal;
  27.        
  28.         cout<<"Masukan Progam Studi : ";
  29.         cin>>m[i].prodi;
  30.        
  31.         cout<<"Masukan Alamat Rumah : ";
  32.         cin>>m[i].alamat;
  33.         cout<<"\n";
  34.     }
  35.     for (int i=0; i<10; i++){
  36.  
  37.         cout<<"Nama : "<<m[i].nama<<endl;
  38.         cout<<"Nim : "<<m[i].nim<<endl;
  39.         cout<<"Tanggal Lahir : "<<m[i].tanggal<<endl<<endl;
  40.         cout<<"Progam Studi : "<<m[i].prodi<<endl<<endl;
  41.         cout<<"Alamat Rumah : "<<m[i].alamat <<endl<<endl;
  42.    }
  43.     cout<<"  ==================================================="<<endl;
  44.     cout<<"  ==== TERIMAKASIH SUDAH MEMASUKKAN BIODATA ANDA ===="<<endl;
  45.     cout<<"  ==================================================="<<endl;
  46.     cout<<"  ==================================================="<<endl;
  47.    return 0;  
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement