Skip to player
Skip to main content
Skip to footer
Search
Connect
Watch fullscreen
Like
Comments
Bookmark
Share
Add to Playlist
Report
Learn Programming Technique C to Master Skills - Explanation of Array
Tutorials Arena
Follow
10/20/2024
Category
📚
Learning
Transcript
Display full video transcript
00:00
Hello everyone, this is Sandeep. Today I'm going to cover one of the important topic
00:08
that is array. Before array we have covered loop, we have covered if statement and in
00:18
those programs we have used local variables. If I have to create one of the program and
00:27
that program is this. One of the easy program is to input salary of three employees from
00:40
keyboard and to display it on screen. Suppose this is the program so you will say that it
00:52
is very easy program. We have to take three variables and then we have to use scanf to
00:59
input the salary of three employees and then we have to use the printf to display the salary of
01:06
three employees. Obviously we have to do this but suppose if I make some changes in this program
01:13
and in spite of three employees if I have to input the salary of 100 employees from the keyboard
01:21
and then I have to display the salary of 100 employees on the screen then naturally
01:30
the length of the program will increase as I have to take 100 local variables and then in
01:36
100 local variables I have to store the value. With the help of scanf I have to read the values
01:43
and store inside the variable and then I have to use printf to display the salary of 100 employees.
01:51
So the length of the program will increase the program will become lengthy and suppose if I
02:00
include that display salary of employees in sorted order. In a numerical sorting you have to do you
02:15
have to display it in a sorted order. As the values are inside the local variables and the
02:22
program is lengthy and then you have to arrange them in a sorted order now it's become more
02:29
complex. So these are the different difficulties which the programmer faced
02:37
and because of this what the C developer did they came up with a new variable they came up with a
02:45
new concept and that new variable is known as what array. So array is a variable which can store
02:55
more than one values of similar data type or you can say array is a variable
03:03
which can store more than one elements of similar data type.
03:09
So in a local variable we can only store a single value but in array variable we can store more than
03:20
one values. So I have explained both the things why array is required and what is array.
03:34
I have given both the reasons I have explained both the reasons.
03:40
So if you have to understand or if you have to define you can say
03:50
group of related elements having common name that is known as array. In C declaration of variable
03:59
like this data type and salary and the size is here inside it that is 10. So this array variable
04:09
can able to hold salary of 10 employees okay and the data type of it is what int. So only the
04:18
integer values are going to store inside it okay above syntax declares array name salary which can
04:27
store 10 elements or we can say that the salary of 10 employees can be stored.
04:35
Once you declare once you write down if I take this example int salary 5, the five locations
04:43
are going to create inside the memory inside the random access memory at run time okay
04:50
for the five employees for the five employees salary okay. In array the counting always starts
04:58
from zero, zeroth position and this is the first position, this is the second, this is the third
05:05
and this is the fourth. So the salary of the first employee is going to reside inside this
05:13
zeroth position, the salary of the second employee is going to reside inside the first position of
05:19
an array, the salary of the third employee is going to store in the second position of an array
05:25
in the same way the salary of the fourth employee is going to reside in the third
05:30
and of it in the fourth position okay. So the counting always starts from zero so from zero to
05:37
fourth it will be what zero one two three four that is total what five okay. So the
05:43
you can say in this way the values can be stored okay and then we can be able to
05:52
display or whatever task is given we can able to perform it.
05:58
To store the values inside this locations of an array on the zeroth, on the first,
06:05
on the second, on the third, on the fourth we have to use loop. In array we have to use loop
06:12
and then only we will be able to store the values inside these memory spaces of an array okay.
06:20
In the next video I am going to explain a simple program that how to store the values
06:27
okay in an array which can store only similar data type values and then how we can able to
06:33
display those values or you can say the elements on the screen. Thanks for today.
Recommended
12:26
|
Up next
Learn Programming Technique C to Master Skills - First Program of Array
Tutorials Arena
10/20/2024
11:41
Learn Programming Technique C to Master Skills - Second Program of Array
Tutorials Arena
11/1/2024
12:03
Learn Programming Technique C to Master Skills - Array of Structure Program
Tutorials Arena
11/10/2024
3:37
Learn Programming Technique C to Master Skills - Pointers And Arrays
Tutorials Arena
11/8/2024
9:58
Learn Programming Technique C to Master Skills - Third Program of Array
Tutorials Arena
11/1/2024
3:40
Learn Programming Technique C to Master Skills - Array of Pointer Program
Tutorials Arena
11/9/2024
13:04
Learn Programming Technique C to Master Skills - Double Dimension Array Program
Tutorials Arena
10/20/2024
9:40
Learn Programming Technique C to Master Skills - Fifth Program of Array
Tutorials Arena
10/20/2024
12:37
Learn Programming Technique C to Master Skills - Fourth Program of Array
Tutorials Arena
10/20/2024
8:45
Learn Programming Technique C to Master Skills - Explanation of Pointer - I
Tutorials Arena
11/8/2024
4:22
Learn Programming Technique C to Master Skills - Pointer And Arrays Program
Tutorials Arena
11/9/2024
8:47
Learn Programming Technique C to Master Skills - Structure Pointer
Tutorials Arena
11/30/2024
5:14
Learn Programming Technique C to Master Skills - Single If Statement Program Explanation
Tutorials Arena
10/12/2024
7:02
Learn Programming Technique C to Master Skills - Sixth Program of Array (Loop with if)
Tutorials Arena
11/1/2024
4:14
Learn Programming Technique C to Master Skills - Explanation of Second Program
Tutorials Arena
10/8/2024
10:31
Learn Programming Technique C to Master Skills - Explanation of Pointer - II
Tutorials Arena
11/8/2024
7:38
Learn Programming Technique C to Master Skills - Recursive Function - I
Tutorials Arena
11/6/2024
12:25
Learn Programming Technique C to Master Skills - Call By Reference Program
Tutorials Arena
11/8/2024
6:13
Learn Programming Technique C to Master Skills - Union
Tutorials Arena
11/10/2024
7:24
Learn Programming Technique C to Master Skills - Linked Lists
Tutorials Arena
11/30/2024
5:21
Learn.Programming Technique C to Master Skills - Introduction of C Language
Tutorials Arena
9/29/2024
7:56
Learn Programming Technique C to Master Skills - Nested If Statement Program
Tutorials Arena
10/12/2024
9:12
Learn Programming Technique C to Master Skills - Program of Recursion
Tutorials Arena
11/6/2024
9:20
Learn Programming Technique C to Master Skills - Union Program
Tutorials Arena
11/10/2024
7:20
Learn Programming Technique C to Master Skills - Explanation of First Program of C Language in Code - Blocks
Tutorials Arena
10/8/2024