C-Programming Variables and Constants


Variables:

Variables are memory location in computer's memory to store data. To indicate the memory location, each variable should be given a unique name called identifier. Variable names are just the symbolic representation of a memory location. Examples of variable name: sum, car, count etc.
int num;
Here, num is a variable of integer type.
Rules for writing variable name in C:

Variable name can be composed of letters (both uppercase and lowercase letters), digits and underscore '_' only.
The first letter of a variable should be either a letter or an underscore. But, it is discouraged to start variable name with an underscore though it is legal. It is because, variable name that starts with underscore can conflict with system names and compiler may complain.
There is no rule for the length of length of a variable. However, the first 31 characters of  a variable are discriminated by the compiler. So, the first 31 letters of two variables in a program should be different.
In C programming, you have to declare variable before using it in the program.

Constants:

Constants are the terms that can't be changed during the execution of a program. For example: 1, 2.5, "Programming is easy." etc. In C, constants can be classified as:

Integer constants:

Integer constants are the numeric constants(constant associated with number) without any fractional part or exponential part. There are three types of integer constants in C language: decimal constant(base 10), octal constant(base 8) and hexadecimal constant(base 16) .

Decimal digits: 0 1 2 3 4 5 6 7 8 9

Octal digits: 0 1 2 3 4 5 6 7

Hexadecimal digits: 0 1 2 3 4 5 6 7 8 9 A B C D E F.

For example:

Decimal constants: 0, -9, 22 etc
Octal constants: 021, 077, 033 etc
Hexadecimal constants: 0x7f, 0x2a, 0x521 etc
Notes:
You can use small caps a, b, c, d, e, f instead of uppercase letters while writing a hexadecimal constant.
Every octal constant starts with 0 and hexadecimal constant starts with 0x in C programming.
Floating-point constants:
Floating point constants are the numeric constants that has either fractional form or exponent form. For example:
-2.0
0.0000234
-0.22E-5
Note: Here, E-5 represents 10-5. Thus, -0.22E-5 = -0.0000022.

Character constants:

Character constants are the constant which use single quotation around characters. For example: 'a', 'l', 'm', 'F' etc.
Escape Sequences:

Sometimes, it is necessary to use newline(enter), tab, quotation mark etc. in the program which either cannot be typed or has special meaning in C programming. In such cases, escape sequence are used. For example: \n is used for newline. The backslash( \ ) causes "escape" from the normal way the characters are interpreted by the compiler.

Escape Sequences:

Escape Sequences           Character
\b                                       Backspace
\f                                        Form feed
\n                                       Newline
\r                                        Return
\t                                        Horizontal tab
\v                                       Vertical tab
\\                                        Backslash
\'                                        Single quotation mark
\"                                       Double quotation mark
\?                                       Question mark
\0                                       Null character
\a                                       bell(sound)

String constants:

String constants are the constants which are enclosed in a pair of double-quote marks. For example:

"good"                                    //string constant
""                                            //null string constant
"   "                                         //string constant of three white space
"x"                                          //string constant having single character.
"Earth is round\n"                  //prints string with newline

Enumeration constants:

Keyword enum is used to declare enumeration types. For example:

enum color {yellow, green, black, white};

Here, the variable name is color and yellow, green, black and white are the enumeration constants having value 0, 1, 2 and 3 respectively by default.

Learn C programming From base to Top


Introduction:

C programming is a popular computer programming language which is widely used for system and application software. Despite being fairly old programming language, C programming is widely used because of its efficiency and control. This tutorial is targeted for beginners who does not have any prior knowledge or have very little knowledge of computer programming. All basic features of C programming language are included in detail with explanation to give you solid platform to understand C programming.

Getting Started With C ....

In order to run a C program, you need a compiler. Compiler change source code(code written by programmer) to object code(code that computer understands) and creates executable file. There are many free and professional compilers available.There are many compilers available such as Netbeans,Eclipse IDE ,DEV C++,TURBO C++ etc. All the examples here are tested and verified in DEV C++ compiler.
Lets Begin With:

Character set:
Character set are the set of alphabets, letters and some special characters that are valid in C language.
Alphabets: 

Uppercase: A B C  ....................................  X Y Z 

Lowercase: a b c  ......................................  x y z

Digits:

0 1 2 3 4 5 6  8 9

Special Characters:

,   <    >  .  _  (  )  ;  $  :   %   [  ]  #  ?  ' &  { } " ^  ! * /  |  -  \  ~  +

White space Characters:

blank space, new line, horizontal tab, carriage return and form feed

HD Nepali Wallpapers App for Android


Nepali Wallpapers™ is the Nepali wallpapers application which includes HD Nepali wallpapers with other additional wallpapers of different categories.                      
 DownloadHD Nepali Wallpapers App For Android.

Screenshots: