Member-only story

Data Types in C with Examples -

Bipsmedium
2 min readJun 3, 2022

--

There are four basic data types in C language. They are given below along with the number of bytes occupied by them in the computer memory. (RAM)

Note that the value range is calculated from the number of bits occupied by the data type. For example, int uses two bytes i.e. 16 bits; from this 1 bit is taken for sign (- or +). So, the range is expressed as -2 to the power 15 to 2 to the power 15–1. (Its decimal equivalent can be calculated by using a calculator but in the case of double, the calculator gives inaccurate answers since they are designed only to handle a small range of values.

Read also, Generation of Computers with their characteristics

The four basic data types in C language are defined as follows

  • Char:- It refers to the character. It can hold one letter and symbol. In fact, the character in c is associated with integers to refer to a letter/symbol as per ASCII( American Standard Code for Information Interchange) that has assigned integer value for all letters/symbols used in programming.
  • int:- This refers to an integer value. This is used to represent the signed or unsigned whole number within a specific range.
  • float:- This refers to a floating-point or real number. It is used to represent a real number like 3.174813 or 4.52e6 with six decimal digits in decimal or exponential form.
  • double:- This also refers to floating-point or real number. It can…

--

--

Bipsmedium
Bipsmedium

Written by Bipsmedium

Hi, This is Biplab and I am a PHP laravel developer and other open source technologies. I am here to share my experience with the community.

No responses yet