0% found this document useful (0 votes)
144 views14 pages

ARRAY

Uploaded by

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

ARRAY

Uploaded by

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

Name : Rakshita Kurahatti Register no.

23BEIS141
Rakshita Raju Basarkod 23BEIS142
Rakshita S 23BEIS143
Rakshitha Prasad 23BEIS144
Rakshitha T J 23BEIS145

Section : D
Topic : ARRAYS
GARDEN
UNIVERSITY
CITY
EMPHASIS ON LIFE

ARRAYS
Arrays are data structures used to store collections of
items, all of the same type, under a single variable
name. They provide a way to organize and access
related data elements more efficiently.
GARDEN
UNIVERSITY
CITY
EMPHASIS ON LIFE

ARRAYS
WHY WE NEED TO USE ARRAY TYPE?
Consider the following issue,
We have a list of 500 students marks of an integer type. If using the basic data
type (int), We will declare something like the following ……
Int studMark0, same studmark1, ….studmark499

By using an array, we just declare like this,


int studmark[500];

This will reserve 500 contiguous memory locations for storing the students marks
GARDEN
UNIVERSITY
CITY
EMPHASIS ON LIFE

ARRAYS
EXAMPLE
INITIALIZATION
In C programming, you can initialize
arrays in a few diverse ways:
1. Static Initialization

2. Loop Initialization
DECLARATION
In C programming, you can declare
arrays using the following syntax:
1. Declaring an Array of Integers:

2. Declaring an Array of Characters:

3. Declaring an Array of Floats:


TYPES OF ARRAYS
One- Two- Multi-
Dimensional . Dimensional ..Arr Dimensional ..Arr
.Array ay y
One-Dimensional
Array
Two- It is an array in which each element is accessed by
Dimensional ..Arr using only one subscript. The only one subscript
represents the position of the element in the array.
ay
Multi- DECLARATION INITIALIZATION
Dimensional ..Arra
y
Example: Example:
Two-Dimensional
Array
Multi-
Dimensional ..A
rray
DECLARATION INITIALIZATION

Example: Example:
Multi-Dimensional Array

A multi-dimensional array DECLARATION INITIALIZATION


is an array of n-
dimensions. In other
words, an array of arrays
is called a multi-
Example:
dimensional array.
Example:
APPLICATION
 Data Storage and Retrieval
 Algorithms and Data Structures
 Scientific Computing
 Image Processing
 Machine Learning and Data Analysis
ACTIVITY
1. What is an Array in C?
A. A group of elements of same data B. An array contains more than one
type. element.
C. Array elements are stored in D. All the above option.
memory continuous or contagious
location.

2. An Array index starts with?


A. -1 B. 0
C. 1 D. 2
ACTIVITY
3. What is the size of an integer array declared as int arr[5] in bytes?
A. 10 B. 20
C. 4 D. 5

4. Which of the following initialization statement store six integer


values in array?
A. int array; B. int array[5];
C. int array(6) D. int array[6]

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy