Jumat, 03 Februari 2012

Basics of Programming Languages ​​C / C + +

This time we will learn about the basics of programming languages C / C + +.
 
In the programming language C / C + + there are several components that we need to know in advance, and we learn, that is:
 
1. IDENTIFIER / IDENTITY
Identifier is a name commonly used in programming to declare variables, constants, data type, and function. Rules for writing the identifier, among other:
•    Can not start with non-letter characters
•    There should be no spaces
•    Should not use these characters ~! @ # $% ^ & * () + '- = {} []: ";' <>?,. / |
•    Should not use reserved words that exist in C / C + +.

2. DATA TYPES
There are some types of data we need to know, below are the various types of data.


3. DECLARATION OF VARIABLES
Just as Pascal, variables used in the program must be declared first. Understanding the declaration here is to introduce variables into the program and specify its data type. Here are examples of variable declarations:






4. ASSIGNMENT
Assignment process is the process of giving value to a variable that was declared. Here is an example of assignment:
 






 5. CONSTANTS
For declaring constants in C + + is similar to Pascal. The syntax is:




6. COMMENT
Comments are used to explain the program and will not be executed in the program. Posting comments is as follows:









Thus the material this time, hopefully the material basics of the language C / C + + can help.
for the next entry we will learn about identifying the component / structure of a program, and learn fix the structure of the program is wrong.

1 komentar:

  1. hey check this new website www.countcode.com. It's a social network made for programmers, where you can download,share or upload source codes, where you can count your own code lines for free. You have access to the web forum and the web chatroom. we are happy to have you joined to our community!

    BalasHapus