0% found this document useful (0 votes)
7 views

Array_in_C_Practical_Work_Formatted

The document provides a comprehensive overview of arrays in C programming, including their definition, syntax, types (single-dimensional and multi-dimensional), and differences between them. It also outlines practical objectives such as sorting and matrix operations, and concludes with a reflection on the learning experience. Additionally, acknowledgments and references are included to highlight the support received during the practical exercise.

Uploaded by

LIGHTNING GAMERZ
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Array_in_C_Practical_Work_Formatted

The document provides a comprehensive overview of arrays in C programming, including their definition, syntax, types (single-dimensional and multi-dimensional), and differences between them. It also outlines practical objectives such as sorting and matrix operations, and concludes with a reflection on the learning experience. Additionally, acknowledgments and references are included to highlight the support received during the practical exercise.

Uploaded by

LIGHTNING GAMERZ
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Definition of Array

An array is a collection of similar data types stored at contiguous memory


locations. It allows storing multiple values using a single variable name, and
elements are accessed using index numbers.

Syntax of Array in C
data_type array_name[size];

Example
int numbers[5] = {10, 20, 30, 40, 50};

This array stores 5 integer values. The indexing starts from 0, so:
- numbers[0] = 10
- numbers[1] = 20
- and so on...

Types of Arrays
1. Single-Dimensional Array

It stores data in a linear form (row).

Syntax:
int arr[5];

2. Multi-Dimensional Array

Usually a 2D array (like rows and columns), can go up to 3D or more.

Syntax:
int arr[3][4]; // 3 rows, 4 columns

Example of 2D Array
int matrix[2][3] = {1, 2, 3},{4, 5, 6}
Difference Between Single and Multi-Dimensional Array
Feature Single-Dimensional Multi-Dimensional
Array Array
Structure Stores data in a single Stores data in rows and
row columns
Syntax int arr[5]; int arr[2][3];
Access Element arr[2] arr[1][2]
Example Use List of marks, ages, Matrices, tables, etc.
etc.
Memory Usage Less complex More complex due to
nested arrays

What is an array?
- Arrays are static, meaning their size must be declared at the start.
- The size should be a constant or known value.
- They can store primitive types (int, char, float, etc.) or even structures.
- Arrays help in loop-based operations like sorting, searching, etc.
- C does not check bounds, so accessing out-of-bound index may cause
errors.
Objectives
 To understand the concept of array
(single dimesnion and Multi Dimensional Array)
 To perform sorting of array.
 To perform matrix operation using array(sum,transpose)
Conclusion
Through this practical exercise, I have gained a clear understanding of
arrays, including both single- and multi-dimensional types. I successfully
implemented sorting techniques using arrays, which helped me understand
how data can be arranged efficiently. Additionally, performing matrix
operations such as sum and transpose using multidimensional arrays
enhanced my logical thinking and programming skills. This practical has
strengthened my foundation in array handling and improved my problem-
solving ability in C programming.
TRINITY INTERNATIONAL SS &COLLEGE
KATHMANDU, NEPAL
2025

Lab Report on (C-Programming)


(Computer Science)

Submitted By:
Name: Krishal Upreti Submitted To:
Grade: Eleven Sanjay Phuyal
Date: 2081/12/25 Department of Computer

Student ID: 32015


TRINIT INTERNATIONAL SS & COLLEGE
KATHMANDU, NEPAL
2025

Lab Sheet #3
(C-Program)

Lab Date: - 2081/12/04

Submission Date: - 2081/12/25

Internal Signature External Signature


ACKNOWLEDGEMENT
This practical on Excel was a great challenge but I would like to express my
heartfelt thanks to all the respected people on this useful.

First and foremost, I would like to thank my computer science teacher,


Sanjay Phuyal Sir, who helped me gain knowledge on this topic throughout
this practical. His expert advice and insights were crucial in helping me
understand the features and functions of C programming. I would also like
the computer science department to provide the needed equipment in this
practical class and a conducive learning environment that facilitates the
successful completion of this useful.

I am also thankful to my friends for providing me the support and ideas on


this practical and my family for giving me the moral support needed during
this practical.

Thank you all for your support and assistance

Krishal Upreti

2081/10/25
REFERENCES

 Wikipedia: Theory on C programming


Retrieved from:-https://wikipedia.org

 W3 school:-Programs of C programs and the concept


Retrieved from:-https://www.w3schools.com

You might also like