0% found this document useful (0 votes)
3 views9 pages

Understanding Arrays in C Programming

Arrays in C allow storing and manipulating similar data types efficiently by grouping them together in a sequence, with array elements accessed via indexes starting from 0, and there are one-dimensional arrays containing a single sequence and multi-dimensional arrays containing multiple sequences arranged in rows and columns. For example, integer, character, and string data can be stored in arrays, which are declared with the array name and size, and individual elements can be accessed and operated on.

Uploaded by

Abdul Mujeeb
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)
3 views9 pages

Understanding Arrays in C Programming

Arrays in C allow storing and manipulating similar data types efficiently by grouping them together in a sequence, with array elements accessed via indexes starting from 0, and there are one-dimensional arrays containing a single sequence and multi-dimensional arrays containing multiple sequences arranged in rows and columns. For example, integer, character, and string data can be stored in arrays, which are declared with the array name and size, and individual elements can be accessed and operated on.

Uploaded by

Abdul Mujeeb
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

Array in C

language
Array

In C programming, one of the frequently arising problem is to handle similar types of data.
For example:
If the user want to store marks of 100 students. This can be done by creating 100 variable
individually but, this process is rather tedious and impracticable. These type of problem can be
handled in C programming using arrays.
An array is a sequence of data item of homogeneous value(same type).
Array are a way of grouping together similar items.
By using array program will be efficient.
Array always start from zero.
Example for C Arrays:
int a[10]; // integer array
char b[10]; // character array i.e. string
Array elements
Types of array

There are 2 types of C arrays. They are,


One dimensional array
Multi dimensional array
Twodimensional array
Declaration of one-dimensional array

Declaration of one-dimensional array

Here, the name of array isage. The size of array is 5,i.e., there are 5
items(elements) of arrayage. All element in an arrayare of the same type
(int, in this case).
Accessing array elements
Example of array in C programming
Task

Enter 5 roll no and students name via


array? As a data entry?????

You might also like