C Programming Introduction

Learn Easily C Programming

What is C Programming?

C is a very  powerful  language.  It was developed in 1972 by Dennis Ritchie. C is simple and easy to use.  It is one of  the best  programming languages. If one wants to learn C++, Java or any other programming language, then he also should learn C programming language. So, let’s start learning.

 IDE for C program Coding:

Many students use “ Codeblocks ” for learning C programming. It’s installation is very easy.
Steps of  Learning C :
1.       Alphabets.
2.       Digits
3.       Special symbols
4.       Constants
5.       Variables
6.       Keywords
7.       Instructions
8.       Program etc.

 Learning Alphabets:
According PC keyboards- the Capital and small letter alphabets are-
Q,W,E,R,T,Y,U,I,O,P,A,S,D,F,G,H,J,K,L,Z,X,C,V,B,N,M and
q, w, e, r, t, y, u, I, o, p, a, s, d, f, g, h, j, k, l, z, x, c, v, b, n, m
 Learning Digits:

Learning special symbols:
~, !, @, #, $, %, ^, &, *, (, ), _, /, \, {, }, [,],|

Learning Constants:

Constants are 2 kinds:
Primary constants and Secondary constants.
The primary constants are: Integer, Real, and Character constants.
The secondary constants are: Array, Pointer, structure, Union, Enum etc.
Characteristics of Integer Constants:
1.       It has at least one digit.
2.       Not have any decimal point.
3.       Can be positive or negative.
4.       Range of integer constants are -32768 to 32767
Characteristics of Real Constants:

1.       It has at least one digit.
2.       Must have a decimal point.
3.       Can be positive or negative.
4.       Comma or blanks are not allowed.

Characteristics of Character Constants:

1.       It may be a single alphabet, digit or single special symbol within a single inverted comma.
2.       Length of character constant is 1.

The secondary constants will be discussed next lessons.
C variables:
Variable acts like a container that contain some values. These are the names memory location.
Rules for variables names:
1.       It may be combination of 1 to 31 alphabets, digits or underscores.
2.       The first character must be an alphabet or underscore.
3.       Comma or blanks are not allowed.
4.       Special symbols (except underscore) are not allowed.
Learning C Keywords:
Some words which meaning are explained in C compiler.
There are only 32 keywords in ANSI  C.
They are-
i)                    auto
ii)                   break
iii)                  case
iv)                  char
v)                   const
vi)                  continue
vii)                default
viii)               do
ix)                  double
x)                   else
xi)                  enum
xii)                extern
xiii)               float
xiv)              for
xv)                goto
xvi)              if
xvii)             int
xviii)           long
xix)              register
xx)                return
xxi)              short
xxii)             signed
xxiii)           sizeof
xxiv)           static
xxv)            struct
xxvi)           switch
xxvii)         typedef
xxviii)       union
xxix)           unsigned
xxx)            void
xxxi)           volatile
xxxii)         while. 

C program Instructions/ Prerequisite:

1.       Each line is written in a separate statement.
2.       Have blank space between two words.
3.       All statements are small letters.
4.       Every statement ends with a semicolon.
5.       Single line comment starts with //
6.       Multiline comments starts with /* ends with */
7.       Program execution  starts from the main() function.

Powered by Blogger.