Pages

SELAMAT DATANG

semoga bermanfaat untuk kita semua

Selasa, 16 Februari 2010

mengenal bahasa pemrograman c

A. TUJUH ELEMEN DASAR PEMROGRAMAN
Borland mengemukanan ada tujuh elemen dasar pemrograman yang harus dipahami oleh para pemrogram, yaitu:
1. ambil informasi dan berikan kepada program.
2. miliki tempat untuk menyimpan informasi di atas.
3. berikan instruksi yang benar untuk memanipulasi data.
4. ambil kembali data, baik berupa data mentah atau hasil olahan, untuk diinformasikan pada pemakai.

Untuk kebutuhan tersebut, Anda dapat mengorganisasikan instruksi-instruksi sehingga:

5. beberapa instruksi hanya dilaksanakan jika suatu kondisi terpenuhi.
6. beberapa instruksi dapat dilaksanakan secara berulang.
7. beberapa instruksi dapat dikelompokkan ke dalam bagian-bagian yang dapat dilaksanakan dari berbagai lokasi program.

Ketujuh elemen dasar pemrograman tersebut secara berturut-turut dinamakan input, data, operasi, output, conditional-execution, loop, dan subprogram.

B. ELEMEN-ELEMEN BAHASA
1. Karakter
Huruf, Angka, dan Garis-bawah
Yang dimaksud dengan huruf adalah A s/d Z dan a s/d z, angka adalah 0 s/d 9, dan garis-bawah adalah _.

White-space
Karakter-karakter space, tab, line-feed, carriage-return, form-feed, vertical-tab, dan new-line disebut white-space character karena mereka mempunyai fungsi sebagai spasi antara kata-kata atau baris-baris. Setiap konstanta dan identifier selalu dipisahkan oleh karakter-karakter ini.

Tanda-baca dan karakter-khusus
Tanda-baca dan karakter-khusus dalam bahasa C mempunyai kegunaan yang bervariasi, dari pengorganisasian teks pogram sampai pendeinisian tugas-tugas yang akan dilakukan oleh kompiler. Karakter-karakter yang termasuk ke dalam kelompok ini adalah:

, . ; : ? ' " ( ) [ ] { } < > ! | / \ ~ + # % & ^ * - =

Escape Sequence
Karakter-karakter escape-sequence adalah suatu urutan karakter yang digunakan untuk mewakili ekspresi suatu karakter lain. Kumpulan karakter ini selalu dimulai oleh karakter backslash (\) dan diikuti oleh suatu huruf atau suatu kombinasi angka.
Daftar karakter-karakter escape-sequence adalah sebagai berikut.

\n new-line
\t horizontal-tab
\v vertical-tab
\b backspace
\r carriage-reurn
\f form-feed
\a bell
\' tanda-petik
\" tanda-kutip
\\ backslash
\ddd karakter ASCII dalam notasi oktal
\xddd karakter ASCII dalam notasi heksadesimal

2. Operator
Operator (lambang-operasi) adalah simbol-simbol, baik berupa satu atau beberapa karakter, yang menetapkan bagaimana suatu nilai dimanipulasi. itu adalah:

! ~ - + * / % < > = | ^ ' ++ -- -= += /= %= << >> ==
!= <= >= |= && || ?: &= ^= <<= >>=

3. Konstanta
Integer Constant
Suatu integer-constant adalah angka desimal, oktal, atau heksadesimal yang mewakili suatu nilai bilangan bulat.
Suatu konstanta-desimal (berbasis-sepuluh) dibentuk oleh sekumpulan angka 0 s/d 9, dengan ketentuan tidak dimulai oleh angka 0. Suatu konstanta-oktal (berbasis-delapan) dibentuk oleh sekumpulan angka 0 s/d 7, dengan ketentuan dimulai oleh angka 0. Suatu konstanta-heksadesimal (berbasis-enambelas) dibentuk oleh sekumpulan angka 0 s/d 9 dan atau huruf A s/d F atau a s/d f, dengan ketentuan dimulai oleh angka-huruf 0X atau 0x. Contoh:

Desimal Oktal Heksadesimal
10 012 0xA
132 0204 0x84
32179 076663 0x7DB3

Floating-point Constant
Suatu floating-point constant adalah angka desimal yang mewakili suatu nilai bilangan nyata. Nilai dari konstanta ini meliputi porsi-porsi bilangan bulat, pecahan, dan eksponen. Aturan penulisan konstanta ini adalah seperti dalam format berikut.

[digit][.digit][E|e[+|-]digit]

Di mana digit adalah berupa sekumpulan angka 0 s/d dan E atau e sebagai simbol eksponen. Contoh:

12E-3 berarti 12 kali 10 pangkat -3
6.25E+4 berarti 6.25 kali 10 pangkat 4

Character Constant
Suatu character-constant dibentuk dengan menempatkan suatu karakter di antara dua tanda-petik (' '). Suatu escape-character dipandang sebagai satu karakter, oleh karena itu dapat dijadikan suatu character constant. Contoh:

'A'
'\n'
'\0x41'

String-Literal
Suatu string-literal dibentuk oleh satu atau sekumpulan karakter yang ditempatkan di antara dua tanda-kutip. Contoh:

"BANDUNG"
"Hari Jum\’at"
"Tit\a\a"
"Baris-1\nBaris-2"

4. Identifier
Identifier adalah nama yang diberikan untuk konstanta-bernama, variabel, jenis-data, fungsi, dan label di dalam program. Setiap identifier yang akan digunakan harus didefinisikan sebelumnya.
Suatu identifier dibentuk oleh satu atau beberapa buah karakter, sebanyak-banyaknya 31 karakter, yang dimulai oleh suatu huruf atau garis-bawah dan dapat diikuti oleh huruf, angka, atau garis-bawah. Catatlah, bahasa C membedakan penggunaan huruf-besar dan huruf-kecil dalam suatu identifier. Contoh:

ClrScr
H2o
TempatTinggal
Nama_Siswa
Kota
Pilihan

5. Keyword
Untuk kegunan dalam pemrograman, bahasa C mencadangkan sejumlah identifier yang telah didefinisikan, disebut keyword, bagi pemrogram. Kata-kata ini merupakan instruksi terhadap C untuk mengerjakan/menyatakan suatu hal tertentu. Oleh karena itu semua keyword tidak dapat didefiniskan-ulang dan hanya digunakan sesuai dengan peruntukannya. Berikut adalah daftar keyword dalam bahasa C.

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

Di samping keyword-keyword di atas, bahasa C menyediakan beberapa keyword lain yang dapat digunakan dalam beberapa implementasi tertentu. Itu adalah:

far near huge cdecl pascal

19 komentar:

  1. I'm truly enjoying the design and layout of your website. It's
    a very easy on the eyes which makes it much more pleasant for me
    to come here and visit more often. Did you hire out a designer to create your theme?
    Outstanding work!

    Visit my web-site - source naturals garcinia 1000

    BalasHapus
  2. I'm excited to uncover this great site. I need to to thank you for your time just for this fantastic read!! I definitely liked every bit of it and I have you book-marked to check out new things in your site.

    Also visit my blog: teeth whitening uk

    BalasHapus
  3. Hi, i think that i saw you visited my weblog so i came to “return the favor”.
    I am trying to find things to improve my web site!I suppose its ok to use some of your
    ideas!!

    Also visit my web page - raspberry ketone diet

    BalasHapus
  4. Hello, I think your web site may be having browser compatibility problems.
    When I take a look at your blog in Safari, it looks fine
    however, when opening in IE, it has some overlapping issues.
    I merely wanted to provide you with a quick heads up!
    Apart from that, wonderful website!

    My blog post ... igf1lr3

    BalasHapus
  5. Have you ever thought about including a little bit more
    than just your articles? I mean, what you say is fundamental
    and everything. Nevertheless just imagine if you added some great photos or video clips to give your posts more,
    "pop"! Your content is excellent but with images and videos,
    this website could definitely be one of the most beneficial in its
    niche. Wonderful blog!

    my web-site: moringa planta

    BalasHapus
  6. Quality articles is the important to interest the viewers to go to see the web page,
    that's what this web site is providing.

    Also visit my website ... green coffee extract weight loss

    BalasHapus
  7. I usually do not leave a response, but I looked through some
    responses here "mengenal bahasa pemrograman c".
    I do have some questions for you if you do not mind.
    Is it only me or does it look as if like a
    few of the remarks look like they are left by brain dead visitors?

    :-P And, if you are writing on other social sites, I would like to keep up
    with you. Could you post a list of all of your public pages like your Facebook page, twitter feed,
    or linkedin profile?

    Also visit my homepage: best teeth

    BalasHapus
  8. I'm gone to inform my little brother, that he should also visit this website on regular basis to get updated from hottest information.

    Visit my webpage - hca supplement

    BalasHapus
  9. Good way of telling, and pleasant paragraph to get data about my presentation subject matter,
    which i am going to convey in university.

    Also visit my blog: garcinia cambogia supplement

    BalasHapus
  10. I seriously love your blog.. Great colors & theme.
    Did you develop this site yourself? Please reply back as I'm hoping to create my own website and would like to learn where you got this from or exactly what the theme is named. Thank you!

    My web-site ... garcinia cambogia side effects

    BalasHapus
  11. Very good blog! Do you have any hints for aspiring writers?

    I'm hoping to start my own blog soon but I'm a little lost on everything.
    Would you advise starting with a free platform like Wordpress or go for a paid option?

    There are so many choices out there that I'm totally confused .. Any recommendations? Bless you!

    Feel free to visit my site ... garcinia cambogia reviews

    BalasHapus
  12. If you want to increase your familiarity just keep visiting this
    site and be updated with the newest gossip posted here.


    My web-site ... cause teeth become

    BalasHapus
  13. Amazing issues here. I am very happy to look your post. Thanks a lot and I'm having a look ahead to contact you. Will you please drop me a e-mail?

    My webpage: raspberry ketone

    BalasHapus
  14. I think this is one of the most vital info for me. Аnd i'm glad reading your article. But wanna remark on some general things, The site style is great, the articles is really excellent : D. Good job, cheers

    Also visit my homepage; raspberry ketone reviews dr oz

    BalasHapus
  15. Υou're so awesome! I do not think I've trulу reаd thrοugh somethіng
    like that before. So wonderful to discover someonе with somе originаl thoughts on this topic.
    Rеally.. many thanks for stаrtіng this up.
    This websіte iѕ something that is requireԁ οn thе web, someone with some
    originalitу!

    Loοk into my web page ... el wire hoodies

    BalasHapus
  16. Thankfulness to my fatheг who informed me concerning thіs weblog, this weblog is really aweѕοme.


    Here is mу website; raspberry ketone slim

    BalasHapus
  17. Thiѕ piece of wгiting will hеlp the internet visitors fоr building up neω
    weblog or even а weblog from stаrt to end.



    Mу web page ... raspberry ketone

    BalasHapus
  18. Ӏ was аble to finԁ good infο fгom yоur blοg ρоsts.


    mу blog; blog.kmi.tl

    BalasHapus
  19. This article preѕents clear iԁea ԁeѕigned for the new vieweгs of blogging, that гeally how tο do
    blοgging аnd site-buіlding.

    Feel free to suгf tο my blog pоst :: www.sportsyork.com

    BalasHapus

Powered By Blogger