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

[Arduino Project-1] -- PushButton Lamp

Apa sih Arduino? Salam, Pada posting kali ini akan menjelaskan tentang tugas kuliah Interaksi Manusia dengan Komputer dan Antar Muka, yaitu membuat lampu push button menggunakan Arduino. Saya anggap pembaca telah mengetahui apa itu arduino. Jika belum tahu, akan saya jelaskan sedikit. Arduino bisa dikatakan sebagai alat untuk membuat sebuah prototye. Kita bisa  membuat apapun (hampir apapun) dengan menggunakan arduino. Seperti membuat sensor panas/dingin,bahkan hingga membuat robot. Arduino sebenarnya diperuntukkan bagi para artist maupun designer yang memerlukan kemudahan dalam merancang produk yang hendak mereka buat. Jadi, untuk menggunakannya tidak diperlukan keterampilan khusus yang tinggi karena di design untuk kemudahan (tentunya setelah tahu dasar-dasarnya). Seperti apa sih Arduino itu? Di bawah ini gambarnya Image Source: https://dlnmh9ip6v2uc.cloudfront.net//images/products/1/1/0/2/1/11021-01a.jpg Arduino ada banyak jenisnya yang bisa dilihat...

Fight

You've been here all along You gotta hear what I said Who are you fooling right now? Never mind what I saw You gotta tell what are you doing here anyway? You mumble and mutter and murmur, speak indistinctly Fine! Don't tell me, don't speak! I don't want to speak to you anyway!

My Blog's Template (Is it beautiful enough?)

Choosing template for our blog is a little bit difficult because we need to make sure it has a nice structure, easily used and perhaps fit in our style or our soul or our wish. Some blogs I found have sooo good in arranging their view so that I can easily browse its contents and also have an eye catching style which makes my eyes keep open. But some blogs also have (if I can say) terrible design which I won't be able to see it twice. It has a lot of ads here and there, it has awful structures like: "I don't know where to begin with" and "I don't know what function is this button for" or "it has bad color choosing", it has so many pictures and some gifs and our cursor is changed into something gross, and so on. Choosing template or theme or our blog's design no needs to be very beautiful (even I don't say that mine is), but at least it has a 'good' design that allows reader to read it easily. I've tried to create template...