logo blog

Contoh Program C++ Kartu Tanda Mahasiswa (KTM)

Contoh Program C++ Kartu Tanda Mahasiswa (KTM)


#include <iostream>
#include <conio.h>
#include <windows.h>

using namespace std;

int main() {
                struct {
                                char NIM[20];
                                char nama[25];
                                char tempat[30];
                                char tanggal[20];
                                char agama[10];
                                char fak[30];
                                char prodi[20];
                               
                }ktm;
             
                cout<<" @@@@@@@@@@@@@@@@@@@@@  \n";
                cout<<" @@@   Program Kartu Tanda Mahasiswa  @@@ \n";
               cout<<"  @@@     Muhammad Husnu Dzihan TIF     @@@ \n";
               cout<<"  @@@@@@@@@@@@@@@@@@@@@ \n";
                cout<<" Masukkan NIM = ";
                cin>>ktm.NIM;
                cout<<" Masukkan Nama = ";
                cin>>ktm.nama;
                cout<<" Masukkan Tempat Lahir = ";
                cin>>ktm.tempat;
                cout<<" masukkan Tanggal Lahir = ";
                cin>>ktm.tanggal;
                cout<<" Masukkan Agama = ";
                cin>>ktm.agama;
                cout<<" Masukkan Fakultas = ";
                cin>>ktm.fak;
                cout<<" Masukkan Prodi = ";
                cin>>ktm.prodi;
                cout<<endl;
               
                cout<<" ---------------------------------------------- \n";
                cout<<"           Cetak Kartu Tanda Mahasiswa          \n";
                cout<<" ---------------------------------------------- \n";
                cout<<" NIM \t\t : "<<ktm.NIM<<endl;
                cout<<" Nama \t\t : "<<ktm.nama<<endl;
                cout<<" TTL \t\t : "<<ktm.tempat<<","<<ktm.tanggal<<endl;
                cout<<" Agama \t\t : "<<ktm.agama<<endl;
                cout<<" Fakultas \t : "<<ktm.fak<<endl;
                cout<<" Prodi \t\t : "<<ktm.prodi<<endl;
                cout<<endl;
               
                getch();
                return 0;
}

Hasilnya :




Share this:

Enter your email address to get update from HusnuBoys.

Enter your email address:

Delivered by HusnuBoys

Tidak ada komentar

Copyright © 2015. Husnu Boys - All Rights Reserved
Template Created by Kompi Ajaib Proudly powered by Blogger