Program yang di debug

// Program yang di debug
#include <iostream>
using namespace std;

int nDibagi(int nBilangan);

int main()
{
    int a;
    cout << "Masukkan sebuah bilangan: ";
    cin >> a;
   
    nDibagi(a);
   
    cout << "Proses pembagian selesai: " << endl;
   
    system("PAUSE");
    return 0;
}

int nDibagi(int nBilangan)
{
    int nHasil;
    nHasil = nBilangan / 0;
    return nHasil;
}

Program Preprocessor #ifndef

// Program Preprocessor #ifndef
#include <iostream>
using namespace std;

int main()
{
    #ifndef DEFINISI
        cout << "Belum didefinisikan" << endl;
    #else
        cout << "Sudah didefinisikan" << endl;
    #endif
    system("PAUSE");
    return 0;
}

Program Preprocessor #ifdef

// Program Preprocessor #ifdef
#include <iostream>
using namespace std;

#define DINYATAKAN

int main()
{
    #ifdef DINYATAKAN
        cout << "Telah Didefinisikan" << endl;
    #else
        cout << "Belum Didefinisikan" << endl;
    #endif
    system("PAUSE");
    return 0;
}

Program Preprocessor #define

// Program Preprocessor #define
#include <iostream>
using namespace std;

#define tampil cout
#define BERHENTI_SEBENTAR system("PAUSE")

int main()
{
    tampil << "Contoh Preprocessor" << endl;
    BERHENTI_SEBENTAR;
    return 0;
}
   

just copy and paste on your compiler, and then study it

copy paste aja di compiler kamu, lalu pelajari