1 / 12

PENGENALAN BAHASA C / C++

PENGENALAN BAHASA C / C++. Erizal , S.Si , M.Kom Sistem Informasi STTI Respati erizalmik@yahoo.com http://erizal.wordpress.com. Program dan Bahasa Pemrograman C. Contoh program dalam Bahasa C untuk meng-input dua buah bilangan, menghitung dan mencetak totalnya. Turbo C. C++.

mayes
Download Presentation

PENGENALAN BAHASA C / C++

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. PENGENALAN BAHASA C / C++ Erizal, S.Si, M.Kom SistemInformasi STTI Respati erizalmik@yahoo.com http://erizal.wordpress.com

  2. Program dan Bahasa Pemrograman C Contoh program dalam Bahasa C untuk meng-input dua buah bilangan, menghitung dan mencetak totalnya Turbo C C++ #include <stdio.h> void main() { int A, B, T; scanf(“ %i ”, &A); scanf(“ %i ”, &B); T = A + B; printf(“ %i ”, T); } #include <iostream.h> void main() { int A, B, T; cin >> A; cin >> B; T = A + B; cout << T; }

  3. 1. 2. 3. 4. 5. 6. void main() { statement statement statement statement } void main() { statement statement statement statement } void main() { statement statement statement statement } void main() { statement statement statement statement } void main() { statement statement statement statement } void main() { statement statement statement statement} Struktur Bahasa C - - - - void main() { statement statement statement statement } - - - - Beberapa contoh penempatan tanda kurung { dan } sebagai batas sebuahmain program.

  4. Keywords dan Library Functions C++ Turbo C #include <iostream.h> void main() { int A, B, T; cin >> A; cin >> B; T = A + B; cou << T; } #include <stdio.h> void main() { int A, B, T; scanf(“ %i ”, &A); scanf(“ %i ”, &B); T = A + B; printf(“ %i ”, T); } Perhatikan kata-kata (words) yang ada dalam kedua program tersebut, yaitu : include stdio.h stream.h void int main() scanf() printf() cin cout

  5. Keyword dalam Bahasa C Keywords dalam ANSI C (ANSI = American National Standards Institute) auto break case char const continue default do double else enum extern float for goto if int long register return short signed sizeof static struct switch typedef union unsigned void volatile while Keywords tambahan dalam TURBO C Selain keywords yang ada pada ANSI C, Turbo C menambah beberapa keywords yaitu : asm cdecl far huge interupt near pascal

  6. Keyword pada C++ Selain keywords yang ada pada ANSI C, C++ menambah beberapa keywords yaitu : asm class delete friend inline new operator private protected public template this virtual

  7. Library Functions dan Library Macroesdalam Turbo C 1) Dalam stdio.h Library Functions Library Macroes clearr() fclose() fccloseall() fdopen() fflush() fgetc() fgetchar() fgetpos() fgets() flushall() fopen() fprint() fputc() fputchar() fputs() fread() free() freopen() fscan() fseek() fsetpos() ftell() fwrite() gets() getw() perror() printf() puts() putw() rename() rewind() scanf() unlink() feof(f) ferror(f) fileno(f) getch(f) getchar(f) putchar( f) remove(path)

  8. 2) Dalam math.h Library Functions abs() acosh() asin() atan() atan2() atof() ceil() cos() cosh() exp() fabs() floor() fmod() labs() ldexp() log() log10() pow() sin() sinh() sqrt() tan() tanh() 3) Dalam stdlib.h Library Functions Library Macroes abs() atof() atoi() atol() div() exit() abs(x) atoi(s) random(num) randomize() Free() ldiv() malloc() rand() srand() system()

  9. 4) Dalam string.h 5) Dalam conio.h 6) Dalam io.h Library Functions Library Functions Library Functions strcpy() strcat() strchr() strcmp() strlen() clrscr() getch() getche() gotoxy() khbit() putch() access() _close() close() _creat() eof() filelength() _ope() open() _read() read() _write() write() 7) Dalam ctype.h Library Macroes Library Functions isgraph( c) islower ( c) isprint( c) ispunct( c) isspace( c) isupper( c) isxdigit( c) toascii( c) _tolower( c) _toupper( c) isalnum( c) isalpha( c) isascii( c) iscntrl( c) isdigit( c) stlower() toupper()

  10. Latihan

  11. Tugas Jelaskan fungsi masing-masing libary berikut ini :

  12. END OF MODUL

More Related