Data Representation
Data representation is the method used by computers to store, process, and understand information internally. Since computers only understand binary values (0 and 1), all data including numbers, characters, images, audio, and videos are converted into binary form.
Understanding data representation is important because it helps programmers understand how memory works, how data is stored, and how programs operate internally.
Overview
Computers cannot understand human language directly. They only understand electrical signals represented by:
- 0 → OFF
- 1 → ON
These binary digits are called bits. Multiple bits together form meaningful data.
| Unit | Description |
|---|---|
| Bit | Smallest unit of data (0 or 1) |
| Nibble | 4 bits |
| Byte | 8 bits |
| Kilobyte (KB) | 1024 bytes |
| Megabyte (MB) | 1024 KB |
| Gigabyte (GB) | 1024 MB |
Why Learn C Language?
C is one of the most powerful and foundational programming languages. It is often called the “mother of modern programming languages” because many languages such as C++, Java, and Python are influenced by C.
- Helps understand computer memory and low-level programming
- Builds strong programming fundamentals
- Used in operating systems and embedded systems
- Improves logical thinking and problem solving
- Fast and efficient execution speed
Binary Number System
The binary number system uses only two digits: 0 and 1.
Every value inside a computer is represented using binary numbers.
| Decimal | Binary |
|---|---|
| 1 | 0001 |
| 2 | 0010 |
| 5 | 0101 |
| 10 | 1010 |
Character Representation
Characters are stored using encoding systems such as ASCII and Unicode.
| Character | ASCII Value |
|---|---|
| A | 65 |
| B | 66 |
| a | 97 |
| 0 | 48 |
Memory Representation
Data inside a computer is stored in memory locations. Each location has a unique address.
In C programming, understanding memory is extremely important because variables directly interact with memory locations.
If an integer variable stores the value 10,
the value is actually stored in binary form inside memory.
Example
// Example of character and integer representation in C
#include <stdio.h>
int main() {
int number = 65;
char character = 'A';
printf("Integer value: %d\n", number);
printf("Character value: %c\n", character);
return 0;
}
Integer value: 65
Character value: A
Understanding the Example
intstores integer valuescharstores character values- The character
'A'internally uses ASCII value 65 - The computer stores both values in binary form
Applications of Data Representation
- Memory management
- File storage systems
- Image and video processing
- Networking and communication
- Operating systems
- Embedded systems programming
Write a C program that:
- Stores an integer value
- Stores a character value
- Prints both values using
printf()
Bonus Challenge:
- Find the ASCII value of the character
'Z' - Convert decimal number 15 into binary
- Research how Unicode differs from ASCII
Flowcharts
Add your explanation, examples, output, and exercises for Flowcharts here.
Overview
Write the overview for this topic.
Example
// Add example C code for Flowcharts
Practice
Add a hands-on practice question for this topic.
Problem Analysis
Add your explanation, examples, output, and exercises for Problem Analysis here.
Overview
Write the overview for this topic.
Example
// Add example C code for Problem Analysis
Practice
Add a hands-on practice question for this topic.
Decision Trees/Tables
Add your explanation, examples, output, and exercises for Decision Trees/Tables here.
Overview
Write the overview for this topic.
Example
// Add example C code for Decision Trees/Tables
Practice
Add a hands-on practice question for this topic.
Pseudo Code and Algorithms
Add your explanation, examples, output, and exercises for Pseudo Code and Algorithms here.
Overview
Write the overview for this topic.
Example
// Add example C code for Pseudo Code and Algorithms
Practice
Add a hands-on practice question for this topic.
Character Set
Add your explanation, examples, output, and exercises for Character Set here.
Overview
Write the overview for this topic.
Example
// Add example C code for Character Set
Practice
Add a hands-on practice question for this topic.
Identifiers and Key Words
Add your explanation, examples, output, and exercises for Identifiers and Key Words here.
Overview
Write the overview for this topic.
Example
// Add example C code for Identifiers and Key Words
Practice
Add a hands-on practice question for this topic.
Data Types
Add your explanation, examples, output, and exercises for Data Types here.
Overview
Write the overview for this topic.
Example
// Add example C code for Data Types
Practice
Add a hands-on practice question for this topic.
Constants
Add your explanation, examples, output, and exercises for Constants here.
Overview
Write the overview for this topic.
Example
// Add example C code for Constants
Practice
Add a hands-on practice question for this topic.
Variables
Add your explanation, examples, output, and exercises for Variables here.
Overview
Write the overview for this topic.
Example
// Add example C code for Variables
Practice
Add a hands-on practice question for this topic.
Expressions
Add your explanation, examples, output, and exercises for Expressions here.
Overview
Write the overview for this topic.
Example
// Add example C code for Expressions
Practice
Add a hands-on practice question for this topic.
Statements
Add your explanation, examples, output, and exercises for Statements here.
Overview
Write the overview for this topic.
Example
// Add example C code for Statements
Practice
Add a hands-on practice question for this topic.
Symbolic Constants [CO1]
Add your explanation, examples, output, and exercises for Symbolic Constants [CO1] here.
Overview
Write the overview for this topic.
Example
// Add example C code for Symbolic Constants [CO1]
Practice
Add a hands-on practice question for this topic.
Arithmetic Operators
Add your explanation, examples, output, and exercises for Arithmetic Operators here.
Overview
Write the overview for this topic.
Example
// Add example C code for Arithmetic Operators
Practice
Add a hands-on practice question for this topic.
Unary Operators
Add your explanation, examples, output, and exercises for Unary Operators here.
Overview
Write the overview for this topic.
Example
// Add example C code for Unary Operators
Practice
Add a hands-on practice question for this topic.
Relational Operators
Add your explanation, examples, output, and exercises for Relational Operators here.
Overview
Write the overview for this topic.
Example
// Add example C code for Relational Operators
Practice
Add a hands-on practice question for this topic.
Logical Operators
Add your explanation, examples, output, and exercises for Logical Operators here.
Overview
Write the overview for this topic.
Example
// Add example C code for Logical Operators
Practice
Add a hands-on practice question for this topic.
Assignment and Conditional Operators
Add your explanation, examples, output, and exercises for Assignment and Conditional Operators here.
Overview
Write the overview for this topic.
Example
// Add example C code for Assignment and Conditional Operators
Practice
Add a hands-on practice question for this topic.
Library Functions [CO2]
Add your explanation, examples, output, and exercises for Library Functions [CO2] here.
Overview
Write the overview for this topic.
Example
// Add example C code for Library Functions [CO2]
Practice
Add a hands-on practice question for this topic.
Formatted Input/Output
Add your explanation, examples, output, and exercises for Formatted Input/Output here.
Overview
Write the overview for this topic.
Example
// Add example C code for Formatted Input/Output
Practice
Add a hands-on practice question for this topic.
Unformatted Input/Output
Add your explanation, examples, output, and exercises for Unformatted Input/Output here.
Overview
Write the overview for this topic.
Example
// Add example C code for Unformatted Input/Output
Practice
Add a hands-on practice question for this topic.
While Statement
Add your explanation, examples, output, and exercises for While Statement here.
Overview
Write the overview for this topic.
Example
// Add example C code for While Statement
Practice
Add a hands-on practice question for this topic.
Do-While Statement
Add your explanation, examples, output, and exercises for Do-While Statement here.
Overview
Write the overview for this topic.
Example
// Add example C code for Do-While Statement
Practice
Add a hands-on practice question for this topic.
For Statement
Add your explanation, examples, output, and exercises for For Statement here.
Overview
Write the overview for this topic.
Example
// Add example C code for For Statement
Practice
Add a hands-on practice question for this topic.
Nested Loops
Add your explanation, examples, output, and exercises for Nested Loops here.
Overview
Write the overview for this topic.
Example
// Add example C code for Nested Loops
Practice
Add a hands-on practice question for this topic.
If-Else Statement
Add your explanation, examples, output, and exercises for If-Else Statement here.
Overview
Write the overview for this topic.
Example
// Add example C code for If-Else Statement
Practice
Add a hands-on practice question for this topic.
Switch Statement
Add your explanation, examples, output, and exercises for Switch Statement here.
Overview
Write the overview for this topic.
Example
// Add example C code for Switch Statement
Practice
Add a hands-on practice question for this topic.
Break and Continue Statements [CO3]
Add your explanation, examples, output, and exercises for Break and Continue Statements [CO3] here.
Overview
Write the overview for this topic.
Example
// Add example C code for Break and Continue Statements [CO3]
Practice
Add a hands-on practice question for this topic.
Functions Overview
Add your explanation, examples, output, and exercises for Functions Overview here.
Overview
Write the overview for this topic.
Example
// Add example C code for Functions Overview
Practice
Add a hands-on practice question for this topic.
Defining Functions
Add your explanation, examples, output, and exercises for Defining Functions here.
Overview
Write the overview for this topic.
Example
// Add example C code for Defining Functions
Practice
Add a hands-on practice question for this topic.
Accessing Functions
Add your explanation, examples, output, and exercises for Accessing Functions here.
Overview
Write the overview for this topic.
Example
// Add example C code for Accessing Functions
Practice
Add a hands-on practice question for this topic.
Passing Arguments to Functions
Add your explanation, examples, output, and exercises for Passing Arguments to Functions here.
Overview
Write the overview for this topic.
Example
// Add example C code for Passing Arguments to Functions
Practice
Add a hands-on practice question for this topic.
Specifying Argument Data Types
Add your explanation, examples, output, and exercises for Specifying Argument Data Types here.
Overview
Write the overview for this topic.
Example
// Add example C code for Specifying Argument Data Types
Practice
Add a hands-on practice question for this topic.
Function Prototypes
Add your explanation, examples, output, and exercises for Function Prototypes here.
Overview
Write the overview for this topic.
Example
// Add example C code for Function Prototypes
Practice
Add a hands-on practice question for this topic.
Recursion [CO4]
Add your explanation, examples, output, and exercises for Recursion [CO4] here.
Overview
Write the overview for this topic.
Example
// Add example C code for Recursion [CO4]
Practice
Add a hands-on practice question for this topic.
Defining Arrays
Add your explanation, examples, output, and exercises for Defining Arrays here.
Overview
Write the overview for this topic.
Example
// Add example C code for Defining Arrays
Practice
Add a hands-on practice question for this topic.
Processing Arrays
Add your explanation, examples, output, and exercises for Processing Arrays here.
Overview
Write the overview for this topic.
Example
// Add example C code for Processing Arrays
Practice
Add a hands-on practice question for this topic.
Passing Arrays to a Function
Add your explanation, examples, output, and exercises for Passing Arrays to a Function here.
Overview
Write the overview for this topic.
Example
// Add example C code for Passing Arrays to a Function
Practice
Add a hands-on practice question for this topic.
Multi-Dimensional Arrays
Add your explanation, examples, output, and exercises for Multi-Dimensional Arrays here.
Overview
Write the overview for this topic.
Example
// Add example C code for Multi-Dimensional Arrays
Practice
Add a hands-on practice question for this topic.
String Declaration
Add your explanation, examples, output, and exercises for String Declaration here.
Overview
Write the overview for this topic.
Example
// Add example C code for String Declaration
Practice
Add a hands-on practice question for this topic.
String Functions
Add your explanation, examples, output, and exercises for String Functions here.
Overview
Write the overview for this topic.
Example
// Add example C code for String Functions
Practice
Add a hands-on practice question for this topic.
String Manipulation
Add your explanation, examples, output, and exercises for String Manipulation here.
Overview
Write the overview for this topic.
Example
// Add example C code for String Manipulation
Practice
Add a hands-on practice question for this topic.
Automatic Variables
Add your explanation, examples, output, and exercises for Automatic Variables here.
Overview
Write the overview for this topic.
Example
// Add example C code for Automatic Variables
Practice
Add a hands-on practice question for this topic.
External Variables
Add your explanation, examples, output, and exercises for External Variables here.
Overview
Write the overview for this topic.
Example
// Add example C code for External Variables
Practice
Add a hands-on practice question for this topic.
Static Variables [CO3]
Add your explanation, examples, output, and exercises for Static Variables [CO3] here.
Overview
Write the overview for this topic.
Example
// Add example C code for Static Variables [CO3]
Practice
Add a hands-on practice question for this topic.
Defining and Processing a Structure
Add your explanation, examples, output, and exercises for Defining and Processing a Structure here.
Overview
Write the overview for this topic.
Example
// Add example C code for Defining and Processing a Structure
Practice
Add a hands-on practice question for this topic.
User Defined Data Types
Add your explanation, examples, output, and exercises for User Defined Data Types here.
Overview
Write the overview for this topic.
Example
// Add example C code for User Defined Data Types
Practice
Add a hands-on practice question for this topic.
Structures and Pointers
Add your explanation, examples, output, and exercises for Structures and Pointers here.
Overview
Write the overview for this topic.
Example
// Add example C code for Structures and Pointers
Practice
Add a hands-on practice question for this topic.
Passing Structures to Functions
Add your explanation, examples, output, and exercises for Passing Structures to Functions here.
Overview
Write the overview for this topic.
Example
// Add example C code for Passing Structures to Functions
Practice
Add a hands-on practice question for this topic.
Unions
Add your explanation, examples, output, and exercises for Unions here.
Overview
Write the overview for this topic.
Example
// Add example C code for Unions
Practice
Add a hands-on practice question for this topic.
Understanding Pointers
Add your explanation, examples, output, and exercises for Understanding Pointers here.
Overview
Write the overview for this topic.
Example
// Add example C code for Understanding Pointers
Practice
Add a hands-on practice question for this topic.
Accessing the Address of a Variable
Add your explanation, examples, output, and exercises for Accessing the Address of a Variable here.
Overview
Write the overview for this topic.
Example
// Add example C code for Accessing the Address of a Variable
Practice
Add a hands-on practice question for this topic.
Declaration and Initialization of Pointer Variables
Add your explanation, examples, output, and exercises for Declaration and Initialization of Pointer Variables here.
Overview
Write the overview for this topic.
Example
// Add example C code for Declaration and Initialization of Pointer Variables
Practice
Add a hands-on practice question for this topic.
Accessing a Variable through its Pointer
Add your explanation, examples, output, and exercises for Accessing a Variable through its Pointer here.
Overview
Write the overview for this topic.
Example
// Add example C code for Accessing a Variable through its Pointer
Practice
Add a hands-on practice question for this topic.
Pointers and Arrays
Add your explanation, examples, output, and exercises for Pointers and Arrays here.
Overview
Write the overview for this topic.
Example
// Add example C code for Pointers and Arrays
Practice
Add a hands-on practice question for this topic.
File Operations
Add your explanation, examples, output, and exercises for File Operations here.
Overview
Write the overview for this topic.
Example
// Add example C code for File Operations
Practice
Add a hands-on practice question for this topic.
Processing a Data File [CO5]
Add your explanation, examples, output, and exercises for Processing a Data File [CO5] here.
Overview
Write the overview for this topic.
Example
// Add example C code for Processing a Data File [CO5]
Practice
Add a hands-on practice question for this topic.