Borland put forward there are seven basic elements of programming that must be understood by the programmer, namely:
ol>
The seven basic elements of programming are respectively called the input, data, operations, output, conditional-execution, loops, and subprograms.
The seven basic elements of programming are respectively called the input, data, operations, output, conditional-execution, loops, and subprograms.
B. LANGUAGE ELEMENTS
1. Character
Letters, Numbers, and Line-bottom
The meaning of the letter is A s / d Z, and as / dz, the number is 0 to 9, and bottom-line is _.
White-space
The characters space, tab, line-feeds, carriage-return, form-feed, vertical-tab, and new-line is called white-space character because they have a function as a space between words or lines. Each identifier constant and always separated by these characters.
Signs reading and special character
Signs reading and special character in C has varied uses, from organizing the text until pendeinisian Vocational tasks that will be performed by the compiler. Characters who fall into this group are:
,. ;:? ! | / \ ~ + # % & ^ * - =" onmouseover="this.style.backgroundColor='#ebeff9'" onmouseout="this.style.backgroundColor='#fff'">' "() [] () <>! | / \ ~ + #% & ^ * - =
Escape Sequence
Characters escape-sequence is a sequence of characters used to represent the expression of a different character. Collection of this character always begins by backslash character (\) and followed by a letter or a combination of numbers.
List of characters escape-sequence is as follows.
\ n new-line
\ t horizontal tab
\ v vertical-tab
\ b backspace
\ r carriage-reurn
\ f form-feed
\ a bell
\ 'Sign-quotes
\ "-Quotation mark
\ \ Backslash
\ ddd ASCII character in octal notation
\ XDDD ASCII characters in hexadecimal notation
2. Operator
Operator (symbol-operation) are the symbols, whether in the form of one or several characters, which specify how a value being manipulated. They are:
! = | ^ ' ++ -- -= += /= %= << >> ==" onmouseover="this.style.backgroundColor='#ebeff9'" onmouseout="this.style.backgroundColor='#fff'">~ - + * /% <> = | ^ '+ + - -= + = / =% = <<>> ==
= |= && || ?: &= ^= <<= >>=" onmouseover="this.style.backgroundColor='#ebeff9'" onmouseout="this.style.backgroundColor='#fff'">! = <=> = | = & & | |?: & = ^ = <<=>> =
3. Constant
Integer Constant
An integer-constant is a decimal number, octal, or hexadecimal that represents an integer value.
A constant-decimal (based-ten) was formed by a set of numbers 0 to 9, with the stipulation does not begin by the number 0. A constant-octal (based-eight) is formed by a set of numbers 0 to 7, with the provisions initiated by the number 0. A constant-hexadecimal (sixteen-based) is formed by a set of numbers 0 to 9 and / or letters A s / d F or as / df, with provisions initiated by a number-letter 0x or 0x. Example:
Decimal Octal Hexadecimal
10 012 0xA
132 0204 0x84
32179 076663 0x7DB3
Floating-point Constant
A floating-point constant is a decimal number that represents a real number value. The value of this constant portions include integers, fractions, and exponents. This constant writing rules are like in the following format.
[digits] [. digits] [E | e [+|-] digits]
Where digits is a set of numbers from 0 s / d and E or e as an exponent symbol. Example:
12E-3 is 12 times 10 power -3
6.25E +4 means 6:25 times 10 power of 4
Character Constant
A character-constant formed by placing a character in the two-quotation marks ( ''). An escape-character is seen as a character, and therefore can be used as a constant character. Example:
'A'
'\ n'
'\ 0x41'
String-Literal
A string literal is formed by one or set of characters placed between the two-quotation marks. Example:
"BANDUNG"
"Today Fri \ 'at"
"Tit \ a \ a"
"Line-1 \ nBaris-2"
4. Identifier
Identifier is the name given to the constant-name, variable, type-data, function, and the label in the program. Each identifier to be used must be defined before.
An identifier is formed by one or several characters, as many as 31 characters, which starts by a letter or a line-down and can be followed by letters, numbers, or line-down. Take note, the language C distinguishes large-capitalization and small letters in an identifier. Example:
Clrscr
H2O
TempatTinggal
Nama_Siswa
City
Options
5. Keyword
To kegunan in programming, C language stoke some defined identifier, called keywords, for programmers. These words are instructions to C to do / express a certain thing. Therefore, all keywords can not be re-defined and used only as intended. Here is a list of keywords in the language 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
In addition to keywords above, the language C provides several other keyword that can be used in some particular implementations. That is:
Tidak ada komentar:
Posting Komentar