12.07.2015 Views

MODUL PRAKTIKUM C ++ - iLab - Universitas Gunadarma

MODUL PRAKTIKUM C ++ - iLab - Universitas Gunadarma

MODUL PRAKTIKUM C ++ - iLab - Universitas Gunadarma

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Modul C<strong>++</strong>Contoh :\t tabulation\v vertical tabulation\b backspace\f page feed\a alert (beep)\' single quotes (')\" double quotes (")\? question (?)\\ inverted slash (\)'\n''\t'"Left \t Right""one\ntwo\nthree"Sebagai tambahan, kita dapat menuliskan karakter apapun dengan menuliskan yangdiikuti dengan kode ASCII, mengekspresikan sebagai octal (contoh, \23 atau \40)maupun heksadesimal (contoh, \x20 atau \x4A).Konstanta Define (#define)Kita dapat mendefinisikan sendiri nama untuk konstanta yang akan kita pergunakan,dengan menggunakan preprocessor directive #define. Dengan format :Contoh :#define identifier value#define PI 3.14159265#define NEWLINE '\n'#define WIDTH 100Setelah didefinisikan seperti diatas, maka kita dapat menggunakannya pada seluruhprogram yang kita buat, contoh :circle = 2 * PI * r;cout

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!