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.
[ 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
Post a Comment