Practice
Resources
Contests
Online IDE
New
Free Mock
Events New Scaler
Practice
Improve your coding skills with our resources
Contests
Compete in popular contests with top coders
Events
Attend free live masterclass hosted by top tech professionals
New
Scaler
Explore Offerings by SCALER

## Bit Manipulation

Last Updated: Nov 17, 2023
Go to Problems
Bit Manipulation
Complete all the problems in this Topic to unlock a badge
Completed
Go to Problems
Contents

# Understanding Data Types

As we have already seen in the previous lesson, the computer only understands binary i.e. the data stored in the Memory (RAM) is in binary form.

Here’s how we can imagine the Memory in a computer to be like the following.

We can see that each of the bytes has got a unique address.

Each digit of a byte is called a bit. A bit can only have two values either 0 or 1. Also  1 byte = 8 bits

When we declare a variable we reserve some amount of memory to store some data. The amount of memory to be reserved depends on the Data Type , The compiler and the machine architecture.  Now let’s look at the types of Data Type which are present and the amount of memory which is reserved for them.

The data types are basically divided into 3 types.

1.  Primitive data type:

• The data types which are built in data types and a user can use them directly to define a variable directly are called Primitive data types.
• Examples: Integer , Character, Boolean , Floating Point , Double , Void ( Valueless) , Wide Character.

2. Derived data type:

• The data types which are derived from primitive data types are known as Derived data types.
• Examples:Function , Array , Pointer , Reference

3. Abstract or User defined data type:

• The data types which are defined by the user itself are known as Abstract data types
• Examples: Class , Structure , Union , Enumeration , Typedef defined Datatype.

The below table shows the size and range of primitive data types.

Using the above table we can pretty much calculate the size of any program. Here are some of the examples.

## Bit Manipulation Problems

0/5
Bit play
0/4
Bit tricks
0/2
Bit array
Topic Bonus
Bonus will be unlocked after solving min. 1 problem from each bucket

## Video Courses By

View All Courses
Excel at your interview with Masterclasses Know More
Certificate included
What will you Learn?
Free Mock Assessment
Fill up the details for personalised experience.
Phone Number *
OTP will be sent to this number for verification
+91 *
+91
Change Number
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
*Enter the expected year of graduation if you're student
Current Employer
Company Name
College/University Name
Job Title
Job Title
Software Development Engineer (Backend)
Software Development Engineer (Frontend)
Software Development Engineer (Full Stack)
Data Scientist
Android Engineer
iOS Engineer
Devops Engineer
Support Engineer
Research Engineer
Engineering Intern
QA Engineer
Co-founder
SDET
Product Manager
Product Designer
Backend Architect
Program Manager
Release Engineer