Fundamentals of C Language - C Programming

 

·         Basic Blocks in C Programming

 


Figure: Basic block in C Programming

First step to learn C is that we must know what Character sets ( alphabets, numbers and special symbols) are used in C, the characters are combine to form some meaningful words those word are compared with constant, variable and keywords. Using these constants, variables and keywords are constructed, and finally combined these to form an instruction. A group of instructions would be combined later on to form a program.

A computer program is just a collection of the instructions necessary to solve a specific problem.

·         Character Set :-

Character set are denoted by alphabet, digit or special symbol used to represent information. The use of these characters can be combined to form constants, variables & keywords. C uses constants, variables, operators, keywords and expressions as building blocks to form a basic C program.

·         Types of Characters in C

The C programming language provides support for the following types of characters:

  • Alphabets
  • Digits
  • Special Characters
  • White Spaces

All of these serve a different set of purposes, and we use them in different contexts in the C language.

  • Alphabets

C program would support a total of 52 different alphabets - 26 uppercase and 26 lowercase.

 

Type of alphabets

Alphabets

Lowercase Alphabets

a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z    (a to z)

Uppercase Alphabets

A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z    ( A to Z)

  • Digits

The C language supports a total of 10 digits for constructing the numeric values or expressions in any program.

Digits

0, 1, 2, 3, 4, 5, 6, 7, 8, 9   ( 0 to 9)

  • Special Characters

We use some special characters in the C language for some special purposes, such as logical operations, mathematical operations, checking of conditions, backspaces, white spaces, etc.

We can also use these characters for defining the identifiers in a much better way. For instance, we use underscores for constructing a longer name for a variable, etc.

The C programming language provides support for the following types of special characters:

 

symbol

meaning

symbol

meaning

,

comma

&

ampersand

.

period

^

caret

:

colon

*

asterisk

?

question mark

-

minus sign

 `

apostrophe

+

plus sign

quotation mark

< 

opening angle bracket ( or less than sign)

!

exclamation mark

> 

closing angle bracket ( or greater than sign)

|

vertical bar

(

left parenthesis

/

slash

)

right parenthesis

\

backslash

[

left bracket

~

tilde

]

right bracket

_

under score

{

left brace

$

dollar sign

}

right brace

%

percent sign

#

number sign

 

  • White Spaces

The white spaces in the C programming language contain the following:

  • Blank Spaces - \b
  • Horizontal tab - \t
  • Carriage Return - \r
  • New Line - \n
  • Form feed - \f

Post a Comment

0 Comments