Basics of C Language {Module-1}

Basics of C Language {Module-1} logo
Basics of C Language {Module-1} logo

Basics of C Language {Module-1}

This blog is dedicated to the students who are new to computer world. As I have seen many of the students have fear of programming language. But the programming language is not that tough as it seems to be. There are hurdles but to overcome these hurdles you have to start practising the programming language. To be a good programmer you have to clear your basic skills in C programming. So, let us start with the C language.

Binary, Hexadecimal and Decimal Numbers

First you should have some knowledge about the Hexadecimal numbers, Binary numbers and Decimal numbers. Hex numbers are those numbers which ends with “H”. For example 1H, 2H, etc. The decimal numbers are the numbers which are written in decimal notation. For example, 0, 1, 2, 3…..and so on. The Binary numbers are in the form of 0 and 1. For example if you have to write 0 in binary it will be written as 0000.

Hexadecimal         Binary                   Decimal

0                              0000                       0                              The Hex number is 0H and the decimal numer is 0.

1                              0001                       1

2                              0010                       2

3                              0011                       3

4                              0100                       4

5                              0101                       5

6                              0110                       6

7                              0111                       7

8                              1000                       8

9                              1001                       9

A                             1010                       10                           In hex numbers instead of 10, A is written and so on 15 is                                                                                                          written as F in Hex

B                              1011                       11

C                              1100                       12

D                             1101                       13

E                              1110                       14

F                              1111                       15

 

Now you must be confused about Binary numbers. So here is the trick for binary numbers

Remember the four digits “8 4 2 1”.

8 4 2 1

0 0 0 0 = 0   in this case all the bits are set to zero so the binary is 0.

0 0 0 1 = 1   in this case the bit number 1 is set to 1 so the binary is 1.

0 0 1 0 =   2   Bit number 2 is set to 1 so binary is 2.

0 0 1 1 = 3    in this case bit 2 and bit 1 is set to 1 so binary is 2 + 1 = 3.

0 1 0 0 = 4    Bit 4 is set to 1 so binary is 4.

0 1 0 1 = 5    Bits 4 and 1 set to 1 so binary is 4 + 1 = 5

For other Binary number refer to the example above

From the above example you must be having a clear idea about the Binary Numbers, Hexadecimal Numbers and Decimal Numbers.

Concept of Bit, Byte and Kilobyte

Now understand some computer terminologies

210 = 1024 =    1K

211   = 2048 =   2K

212   = 4096 =   4K

213   = 8192 =   8K

214   = 16384 = 16K

215   = 32786 = 32K

2 16 = 65536 = 64K

 

Here 1K means 1 Kilobyte (Kb), 2K means 2 Kilobytes (Kb) and so on. 1024 Bytes make 1 Kilobytes (Kb).

8 bits means 1 Byte.

After understanding the concept of Bytes, Bits, and Kilobytes, let us take a look on four cases regarding C language.

177, -24, 3.99, ABCD

Incase of these four cases:

  1. The first number is an unsigned integer.
  2. The Second number is a signed integer
  3. The Third number is a real number
  4. It cannot be a number.

 

Things you should remember

  • In any computer language, anything on a computer gets stored in binary i.e. 0’s and 1’s.
  • Ordinarily a number will be stored as an unsigned integer unless you give a sign to that number
  • There are number of unique ways of representing numbers. Some of them are
  1. Signed Numbers
  2. Unsigned Numbers
  3. Real numbers

 

  • The basic unit of storage allocation is byte. A number can be stored in 1/2/4/8 bytes i.e. you can require a few bytes for storage.

This Was the Basics of C Language Module 1, Read Module 2

About Sumesh Dhar 36 Articles
Jammu Born 22 | Tech Blogger | YouTuber | Big Data Engineer| Google Certified Digital Marketer |Microsoft Certified Cyber Security Associate | Digital Marketing Consultant at Many Startups |Founder @GlobaleTimes and InfiniteTechInfo | Computer Engineer @Sinhgad Institutes| Developer | Music Lover | Traveller | Pune, India

4 Comments

3 Trackbacks / Pingbacks

  1. Data Types in C Language
  2. Control Structures in C language – {Module-4}
  3. Different types of Data Structures

Leave a Reply

Your email address will not be published.


*