Pertemuan 05 - 06 Pemrograman C

Post on 07-Jul-2015

463 views 4 download

Transcript of Pertemuan 05 - 06 Pemrograman C

PEMROGRAMAN CContinued

Safars.hidayat@gmail.com

Review Statement Output

Statement Output

• Escape sequences character Ÿ karakter dengan makna khusus menggunakan notasi \ (back slash)

Statement Output

Escape Sequence Character

Escape Sequence Character

• Apa bedanya %f dan %.2f?

Penulisan tipe data

Statement output: puts

Contoh program puts

Statement output: putchar

Contoh program putchar

#include <stdio.h>#include <conio.h>

int main(){putchar('U');putchar('I');putchar('K');putchar('A');getch(); }

Statement output: cout

Contoh program cout

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

int main(){cout << "Hello World" << endl;getch(); }

Statement Input

Statement Input: scanf

Statement Input: gets

Contoh program gets

Statement Input: cin

Contoh program cin

Statement Input: getche

LatihanBuat program C untuk menampilkan karakter berikut: