Data Types, Variables and Constants

Built-in Data Types

Built-in Data types are those data types that are pre-defined by the programming language. Most languages have native data types that are created for ease of execution of data. Such Data types are called Built-in Data Types. These data types can be used directly in the program without the hassle of creating them. Every programming language has its own specific set of built-in data types. We will learn about a few of them in this article below.

Definition

The term Built-in itself tells us that these categories of data types are defined by the programming language at prior.Built-in Data types are those data types that can be directly used by the programmer to declare and store different variables in a program.

They are also called Primary or Primitive Data Types. These Data types are believed to be one of the fastest modes to execute operations on Data. The syntax used for defining these data types is different for each programming language.

Real-Time Example of Built-in Data type

Suppose we want to create an automatic exam grading system for the students of a school. The data which we require will be Names, Roll numbers, Class, Division, Subjects, Marks, Grades. This data consists of various categories of data like Alphabets, Strings, Characters, Integers, Decimal numbers, Symbols, etc. For this purpose, we can use the built-in data types which are provided by the programming languages. This data can be fed into the program by using the built-in data types such that the system finds it easy to accept, calculate, interpret and give results to the user.

Built-in Data Types

Different Built-in Data Types

Int, char, float, double, Boolean, void – are the most basic and common built-in data types in every programming language. Other than these if you want to work with complex data categories, you will have to define them yourself. Let’s look at these data types in depth-

1. Int 

This Built-in data type represents an integer number. It does not support any decimal or fractional number. Generally, Int has been allocated 4 bytes/32 bits of memory space. Integer numbers can contain Positive as well as Negative numbers.

Int Data Type is further divided into 2 type –

Signed Int – Allows positive as well as negative numbers.
Unsigned Int – Allows only positive numbers.

Ex:- 29, -50, 1947, 50384

2. Char

This data type accepts character values from the user. These characters include single letter, digit, symbol, special characters, etc. Char data type occupies 2 bytes/16 bits of memory space.

Ex:- ‘A’, ‘$’, ‘g’, ‘5’

3. Float

Float data type represents numbers that are in decimal format. They are commonly called floating-point numbers. Float takes up 4 bytes/32 bits of memory space.

Ex:- 25.56, 785.383, -3674.7358, -10

4. Boolean

This data type consists of only 2 values: True or False. It is a logical type of built-in data type. The default value of Boolean data type is False.

5. Double

It is a variant of the Floating-point data type which is also used to represent fractional and decimal numbers. Generally, 8 bytes/64 bits of memory space is allocated to it.

6. Void

This data type is widely used in C and C++ languages. It indicates that it has no value/empty. This data type is mainly used as a return type for functions that do not return a value to the caller function.

Browse more Topics Under Data Types, Variables and Constants

FQAs on Built-in Data Types

Q1. Which of the following is not a Built-in data type?

  1. Int
  2. Char
  3. Array
  4. Float

Answer – Option C, Array is a User-defined data type.

Q2. What is the size of the Float data type?

  1. 1 byte
  2. 4 bytes
  3. 2 bytes
  4. 6 bytes

Answer – Option B

Q3. The default value of Boolean is?

  1. True
  2. Null
  3. False
  4. Garbage

Answer – Option C

Share with friends

Customize your course in 30 seconds

Which class are you in?
5th
6th
7th
8th
9th
10th
11th
12th
Get ready for all-new Live Classes!
Now learn Live with India's best teachers. Join courses with the best schedule and enjoy fun and interactive classes.
tutor
tutor
Ashhar Firdausi
IIT Roorkee
Biology
tutor
tutor
Dr. Nazma Shaik
VTU
Chemistry
tutor
tutor
Gaurav Tiwari
APJAKTU
Physics
Get Started

Leave a Reply

Your email address will not be published. Required fields are marked *

Download the App

Watch lectures, practise questions and take tests on the go.

Customize your course in 30 seconds

No thanks.