Makro # Define #include <stdio.h> #include
#include # define phi 3.14 # define luas(r) phi*r*r main() { cout<<"HITUNG LUAS LINGKARAN"<<endl; cout<<"Jika r=10 maka =>"<"<
# IF,#ENDIF,#ELIF,#ELSE #include <stdio.h> #include #include #define nilai 8 main() { #if nilai>10 cout<<"Nilai = "<
# UNDEF #include <stdio.h> #include #include # define nilai 10 #if nilai>10 #undef nilai #define nilai 11 #elif nilai<10 #undef nilai #define nilai 8 #else nilai==10 #undef nilai #define nilai 99 #endif main() { cout<<"Maka Nilai Update = "<
# IFDEF ,#IFNDEF #include <stdio.h> #include #include # define namaku "aye" # define namamu main() { #ifndef namamu cout<<"Panggil Namamu = "<
else if (strcmp(kd_buku,"SAD")==0||strcmp(kd_buku,"sad")==0) { judul="Sytem Analysis Design"; peng="Subagyo"; harga=100000; } else if (strcmp(kd_buku,"JAV")==0||strcmp(kd_buku,"jav")==0) { judul="Java Fundamental"; peng="Wahono"; harga=500000; } else { judul="=="; peng="=="; harga=0; }
if (jml_beli>9) { diskon=0.1*harga;} else if (jml_beli>6) { diskon=0.04*harga;} else { diskon=0.02*harga;} bayar=jml_beli*harga; pajak=0.05*harga; total=bayar-diskon+pajak; } menu() mulai cetak<<"Masukan Nama Pembeli = ";input>>pembeli; cetak<<"Masukan Kode Buku = ";input>>kd_buku; cetak<<"Masukan Jumlah Beli = ";input>>jml_beli;
buku(); clrscr(); cetak<<"Maka Nama Pembeli = "<