-->
Search here and hit enter....

Basic Information related to C language or Programming language

Hello, Viewer's in the previous post we learn about the translator (Compiler, Interpreter). Now in this post, we learn about the C programming language. So let's start
History of C language


c language


C language was developed by the "Dennis Ritchie" in 1972 at BT & T laboratories. (also check the images for more history of C )

  • It is a combination of high-level programming language.
  • It is used in almost all software.
  • It is fast, reliable and highly portable and can run under a various operating system. 


Application of C

  • C language finds in business, education, scientific etc field. It provides various type operation and statements to solve computationally problem.
  • C is used in system software such as operating system, compiler etc and application software such as verification software, test code etc.


Some Important terms
There are many important terms/topic in the programming world. we study all terms one by one.

Identifiers
Identifier is a fundamental building block of the program and it is a combination of permissible character.
 Rules for writing an Identifier

  • Only alphabetic letters, digits and underscore are permitted in an identifier.
  • An Identifier name can't start with a digit.
Keywords
There is some identifier in C which have predefined meaning these identifiers are called keywords.
Examples: int, char, float, sizeof, void etc.

Tokens
Tokens is a group of characters which represent keywords, operators, and identifiers.
Examples: 
  • Keywords 
  • Identifiers ( declare by the program )
  • Operator ( +, -, <, >, =, etc. )
  • Numeric ( 24, 24.35, 0.08 etc. )
  • Characters
Constant
Constant are the fixed data value that do not change their values during the execution of a program. these are also called "Literals".

Variables
Variable is a name of the memory location where a program saved. we can change the value of a variable during the execution of a program.
Rules for Naming a Variable
  1. The first character of a variable should always be the alphabet.
  2. Special character ( except- Underscore ) can't be part of a variable name.
  3. The Variable name can have a combination of Lowercase & Uppercase.
  4. The variable should not be a keyword.
Datatypes in C
There are various datatypes in C are follows:-
  1. Primitive Datatype
  2. Derived Datatype
  3. User Defined Datatype
1. Primitive Datatype
It includes
  • Characters or char ( a,b,v etc )
  • Integer or int ( 21, 20, 98 )
  • Floating ( 20.2, 23.26,0.08 )
  • Fixed Point Number
2. Derived Datatype
C also supports three types of derived data
  1. Array
  2. Function
  3. Pointer
3. User Defined datatype
C support three type of user-defined datatype
  1. Structure
  2. Union
  3. Enumerated
Integer
Any Numbers which have no points.
Example: 50, 0, -44

Character
In which include single codes ( ' ' ) and only one symbol.
Example: 'a', 'b', 'l' etc.

Floating
Any Numbers which have points.
Example: 20.0, 52.3, 89.9 etc.

Array
  • An array is a linear collection of similar elements. An array is also known as "Subscript Value".
  • An array is a group of a variable.
  • Array indices start at Zero in C and go to one less than the size of array.
Declaration of Array:
   variable_name[num_elements]

Example:  
  int A[100];

  • It creates an array A with 100 integer elements.
  • The size of array A can't be changed.
  • The number between brackets must be a constant.
Initialization of an Array: 

int A[5] = {0,1,2,3,4}; // Array can be initialize during declaration

Pointer
  • A pointer is a variable that contains the address of another variable.
  • Pointer always consumes 2 bytes in memory. ( for a 16-bit compiler )
Syntax
data_type*variable_name

Example
int *p;
char*p;
where * is used to denote that "p" is pointer variable and not a normal variable.

  • The value of a null pointer is zero.
  • "&" symbol is used 2 get the address of a variable.
  • "*" symbol is used 2 get the value of the variable.


Thanks 4 reading our blog! hope you like it. In the next post we'll discuss more basic fundamentals related to programming world.





FB COMMENTS ()