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

CM304

This document provides an overview of arrays for a computer engineering class. It defines one-dimensional arrays as arrays whose elements are specified by one subscript. It gives the general declaration format of data type array name[size] and provides an example program to declare and use a one-dimensional integer array. The document also summarizes the different types of arrays as one, two, and three dimensional and reviews the declaration of a one dimensional 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)
47 views

CM304

This document provides an overview of arrays for a computer engineering class. It defines one-dimensional arrays as arrays whose elements are specified by one subscript. It gives the general declaration format of data type array name[size] and provides an example program to declare and use a one-dimensional integer array. The document also summarizes the different types of arrays as one, two, and three dimensional and reviews the declaration of a one dimensional 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/ 14

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 : Array Declaration.
Teaching Aids : Diagram and animations, PPTs.
CM304.56 1
Objective

On completion of this period you would be


able to know
 Array declaration
One-dimensional array.

CM304.56 2
Types of Arrays

 One-dimensional array.
 Two dimensional array.
 Three dimensional array.

CM304.56 3
Declaration of Array

datatype array_name[size];

 datatype is the type of element will be contained in


array. such as int, float, char.
 array_name is name of the variable .
 size is the maximum number of elements stored in
array.

CM304.56 4
One-dimensional array

Definition:
Whose elements are specified by one subscript
that array is called One-dimensional array.

General form of one-dimensional array:

datatype variable_name [size];

CM304.56 5
Simple program using one-dimensional array
#include<stdio.h> Data type
Variable name
main( )
{
int marks[5]; Array size

int i;
printf (“enter the marks”);
for(i =0;i<5;i++)
{
scanf (“%d”, &marks[ i ]);
printf (“the entered marks is %d \n”, marks[ i ] );
}
} CM304.56 6
Summary

 Different types of arrays, like one


dimensional array.
 Declaration of one dimensional array with
general form and with examples.

CM304.56 7
Quiz

1.Types of arrays….?
a) one dimensional
b) two dimensional
c) three dimensional
d) all of the above.

CM304.56 8
Quiz

1.Types of arrays….?
a) one dimensional
b) two dimensional
c) three dimensional
d) all of the above.

CM304.56 9
Quiz

2. Which array declaration is correct?


a) data type array_name [size];
b) data type variable name [size] [size];
c) data type variable name;

CM304.56 10
Quiz

2. Which array declaration is correct?


a) data type array_name [size];
b) data type variable name [size] [size];
c) data type variable name;

CM304.56 11
Quiz

3.What is one dimensional array?


a) elements have one subscript.
b) elements have two subscripts.
c) elements have three subscripts.

CM304.56 12
Quiz

3.What is one dimensional array?


a) elements have one subscript.
b) elements have two subscripts.
c) elements have three subscripts.

CM304.56 13
Frequently Asked Questions

1. Define one-dimensional array and represent


the same with the help of schematic diagram.

CM304.56 14

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