Skip to main content

Brief NotesC Language: Comments, Executable Expression, and Constant

This is just my note when I attended the lecture. I write this here so it will be long lasting.  :D 

[ Comment(s) ]
In C, an expression or a sentence is ended with mark ';' (semicolon).
There are two kinds of sentence. An executable and non-executable sentence. A non-executable sentence is called a comment.
A comment is used to give some explanation to the reader (human) so our code will be possibly more understandable to human to read it. As a comment, this sentence will not be executed when our code is runned.
We can write a comment like this:


The first type is using /* */. This type can contain multiple lines. It means that everything surrounded by '/*' and '*/' mark is considered as a comment.
And second type is using //. This type can only have one line. It means that everything behind that mark, as long as it is still in the same line, it will be considered as a comment.

[ Executable Expression ]
Executable expression is, as I mentioned before, a sentence which will be executed when our code is runned. This is what we do code for.

[ Literal Constant ]
There are several types of literal constant :
Integer consists of set of number, such as: -1, 0, 3, etc.
Character consists of one or more set of character(s) surrounded by mark apostrophe ('). Ex: 'a', 'G', '#', etc.
Float consists of decimal number. Ex: 3.14, 0.5, 2.54, etc;
String is a set of characters and written surrounded by " and ". It is an array of character. Ex: "you", "harmonic convergence", etc.

Comments

Popular posts from this blog

Visiting Animals with My Family

Big day, big day, big day.... /XD Yup, this is a very big day, for me. Why? Because, my parents, and my brother, are coming. I'm pretty excited, but also nervous. You know how it feels when you have a very messy room, and you got your parents are coming? Or you don't know what to do with your family as you have a tiny sized room? Arrhg /shock, it's complicated. But very exciting too. X-D First time of our journey, we were arriving at Sabuga. One of the lovely building style in here (ITB) is the classical stone that covers almost in all the part of the building... Oho, what is this? :P I was not using a professional camera, and I'm not a photographer too, so I couldn't make a good one. hehe. Bye the way, this is under the ground pipe.. Some places in ITB are unique (people said that), and one of them are 'echo point'. This place, if you speak up loud enough, will be able to spread out into all around of ITB and everyone's gonna...

Lakukan Apapun yang Menjadi Renjana-mu Meskipun Hidupmu Semenjana

Judul di atas mungkin sedikit sulit diartikan atau bahkan membingungkan bagi kita. Mungkin ada juga yang mengira kalau aku menyisipkan kata-kata asing atau apa. Padahal sebenarnya, semua deretan kata dalam judul diatas murni bahasa kita tercinta, Bahasa Indonesia. Ya, semuanya kata asli Indonesia. Hanya saja kita tidak terbiasa menggunakannya yang membuat kita merasa asing. Padahal jika aku ganti dengan kata asing, kalimat itu justru tidak asing. Ini nih: "Lakukan Apapun yang Menjadi Passion -Mu Meskipun Hidupmu Biasa-biasa Saja ". Sekarang jauh lebih mudah dimengerti kan? Terlepas apakah kalimat itu punya makna atau tidak, akan tetapi, kita lebih mudah mencerna setiap kata dalam kalimat itu. Hal ini memang miris mengingat kita lebih kenal dan lebih dekat dengan bahasa asing dari pada bahasa asli sendiri yang membuat kita merasa asing dengan bahasa sendiri dan bahasa asing malah tidak terasa asing karena sering kita gunakan. #mbulet-mbulet kalimatnya Sis: "Bro, ...

Ramadhan 1435H & Silaturahmi keluarga

Baju baru alhamdulillah, tuk dipakai di hari raya, Tak punya pun tak apa-apa, masih ada baju yang lama. Sepatu baru alhamdulillah, tuk dipakai di hari raya, Tak punya pun tak apa-apa, masih ada sepatu yang lama. Kue baru alhamdulillah, tuk dimakan di hari raya, Tak punya pun tak apa-apa, masih ada kue yang lama. /wahaha Alhamdulillah, tidak terasa ramadhan telah berlalu. Rasa syukur ku kepada Allah SWT. karena telah diberi kesempatan untuk bisa bertemu ramadhan tahun ini sampai selesai. Meskipun Ramadhan udah selesai, semoga hati dan jiwa tetap fitri dan selalu terjaga. Ramadhan kali ini sangat menyenangkan meskipun setengahnya aku jalanin tanpa keluarga, tanpa sanak saudara yang menemani jerih payah puasa. /sweat Tapi ngga papa, yang penting inti dari ibadah bulan ramadhan tetep didapat. #intinya apa ya? Seperti ramadhan-ramadhan sebelumnya, setiap satu minggu sebelum lebaran ibu (dan aku) pasti bikin kue-kue penghias meja. Kali ini pun sama. Aksi bikin kue pun terjadi...