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

CM304

This document discusses an introduction to arrays presented in a computer engineering lecture. It begins by explaining that arrays allow storing multiple elements of the same type under a common name, as opposed to regular variables that can only store one element. It then provides an example of declaring and initializing an integer array with 6 elements indexed from 0 to 5. Finally, it summarizes that the class taught about array introduction, storing values in regular and array variables, and the definition of an array.

Uploaded by

api-3849444
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views

CM304

This document discusses an introduction to arrays presented in a computer engineering lecture. It begins by explaining that arrays allow storing multiple elements of the same type under a common name, as opposed to regular variables that can only store one element. It then provides an example of declaring and initializing an integer array with 6 elements indexed from 0 to 5. Finally, it summarizes that the class taught about array introduction, storing values in regular and array variables, and the definition of an array.

Uploaded by

api-3849444
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 16

DEPARTMENT OF TECHNICAL EDUCATION

ANDHRA PRADESH
Name of the faculty : K.Jeevan Kumar
Designation : Lecturer.
Branch : Computer Engineering
Institute : V.K.R & V.N.B Polytechnic Gudivada
Year/Semester : III Semester
Subject : UNIX & C
Subject Code : CM-304
Topic : Understand basics of Arrays.
Duration : 50 Min
Sub Topic : Introduction to Arrays and definition.
Teaching Aids : Diagram and animations,ppt.
CM304.55 1
Objective

On completion of this period you would be


able to know

 Array concept.

CM304.55 2
Arrays
What is an array?
The variables are created with primary data types like int,
float, char.

Each variable is given a unique name and can store


one item (or) element under that name.

CM304.55 3
Arrays Contd..

For example :
int a; In variable a you can only enter one value

 The variable a can store only integer value .

 This process is easy to store one or two values but difficult


for more .

CM304.55 4
Arrays Contd..

 Some times you want several same elements


(or) items to be grouped under same variable name.
 That situation is possible in arrays.

For example :
We want 6 elements in variable a that is

0 1 2 3 4 5
a

the 6 elements are under the common name ‘a ’

CM304.55 5
Array definition

 Array is a collection of data elements of the same type.


 They are referred by a common name.
Array
identit
Array
y
name
sub[0] sub[1] sub[2] sub[3] sub[4]
sub[5]
sub
array
Element Elemen Elemen Element Element 5Element 6
1 t2 t3 4
Array
element
s
CM304.55 6
Summary

In this class you have learnt about,


• Introduction to arrays.
• How to store the values in the normal
variable and array variable.
• Definition of array.

CM304.55 7
Quiz

1.Array is used to…?


a) To store similar type of data elements.
b) to store dissimilar type of data elements.
c) to store limited number of elements.

CM304.55 8
Quiz

1.Array is used to…?


a) To store similar type of data elements.
b) to store dissimilar type of data elements.
c) to store limited number of elements.

CM304.55 9
Quiz

2. int a; in the declaration part how many values


are stored?
a) no values.
b) two values.
c) only one value.

CM304.55 10
Quiz

2. int a; in the declaration part how many values


are stored?
a) no values.
b) two values.
c) only one value.

CM304.55 11
Quiz

3. int a[5]; in the declaration part how many values


are stored?
a) one value.
b) five values.
c) four values.

CM304.55 12
Quiz

3. int a[5]; in the declaration part how many values


are stored?
a) one value.
b) five values.
c) four values.

CM304.55 13
Quiz

4. The subscript must be specified with in


the_____?
a) Square brackets [].
b) Parenthesis ().
c) Braces {}.

CM304.55 14
Quiz

4. The subscript must be specified with in


the_____?
a) Square brackets [].
b) Parenthesis ().
c) Braces {}.

CM304.55 15
Frequently Asked Questions

1. Define array and represent the same with the


help of schematic diagram.

CM304.55 16

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