Selasa

VARIABLE

Variable is an identifier (identifier) ​​used to represent a value
in particular in the process of program.Nilai a variable can vary so
calm with which always remains constant. The variable is a placeholder
value / data.

Variable Naming:
1. May not use the symbol-specific symbols except underscore.
Special Symbol $,?,%,#,!,&,*,(,),-,+,= etc.
2. It should not be preceded by the numbers.
3. written in all lowercase.
In the C language, all variables that will be used must be declared first.
The declaration states the type of data and followed by the name of the variables.
As for the types of data exist: the size of Range Format
- Char for character data types
- Int for spherical data type
- Float to fractions
-Long int for integer greater.
- Double to more extensive fractional
A. Declaration of Constants (# define)
In C is declared with # define
Example:
# Define Phi 3:14
# Define NIM "01,233"
# Define name "wakhidnusa"
SYNTAX: # define namavariabel value
Example: # define max 12

B. Praprosessor (# include)
praprocessor instruction is used as an investment in a file that is used in
program.
SYNTAX: # include <namafile.h>
Example: # include <stdio.h>, this statement is included if the program uses the routine
input and output for example:
function printf (), scanf (), getchar (), putchar (), puts (), gets ().
A program C is written from several elements:
- Statement
- Block statement
- Function blocks
A statement is one or more expression that ends with a dot
semicolon (;).
Statement block is composed of one or several statements that begin with
mark {and end with a}. Block statement always begins with a
instruction.
Function blocks consist of one or several statements designed to
perform a particular process. Function block starts with the name of the function () and sign {
and ends with a sign}

Congratulations Learning

Tidak ada komentar:

Posting Komentar