36 - INSERTION OF AN ELEMENT INTO AN ARRAY AT SPECIFIC POSITION - C PROGRAMMING

preview_player
Показать описание
Major Operations that can be performed on arrays are
1. Insertion
2. Deletion
3. Sorting
4. Searching

This video explains the process of inserting an element into an array at specified position.
User have to specify the position where the element to be inserted and the element which to be inserted.
Here POSITION given by user is the INDEX value.
Рекомендации по теме
Комментарии
Автор

Hi Friends
There is a Little mistake in the second for loop please make a notice
the condition has been written wrong as i<=position.
CORRECT CONDITION : i>=position.
Sorry for the mistake.
Please make a notice and correct it.

sundeepsaradhi
Автор

hi viewers
Small correction in the above program.
here POSITION is the index value for an element.

sundeepsaradhi
Автор

I have got to say this, You're teaching is absolutely perfect. I've never before understood a program on the first go. Thanks a lot and keep up the good work!

ajayvs
Автор

Sir in the 2nd for loop u did the mistake on sign it should be i>=position

gauravchandra
Автор

He is really helping me in data structure

johnchamba
Автор

TanQ u sir. I just watched ur 2 topics. Very clear explaination ☺🙏

shravanparnandi
Автор

there is a little mistake so the correct loop will be :
for(i=r-1;i>=pos-1;i--)
a[i+1]=a[i];
a[pos-1]=element;
printf("result is :\n\n");
for (i=0;i<=r;i++)
printf("%d\t", a[i]);

bhuwanghimire
Автор

How can you add an element to a[5] when the size is 5. It can only hold elements from 0 to 4

nikhilranjankumar
Автор

Sir first time i thought that your tuturiol will be boring because they have no practical explanation so I always watched #smartprogramming videos but now I realised that you are the best 👍👍👍👍

priyanshupandey
Автор

thanks Sundeep this is just what I was looking for!

jsoliz
Автор

nicely explained sir, keep it up, thank you 👍👍👍👍🙂🙂🙂🙂

SmartProgramming
Автор

Should there be a condition loop where it is checked that the position is less than the total size of the array. Otherwise the program may show error

ashashreesarma
Автор

Sir why you are decremented the ' i' value from last before step??

saisriharshayellaboyina
Автор

thank you so much sir for making my concept crystal clear 🙏

himanshujain
Автор

This is the Best playlist available on Youtube on C Programing

prateeklohani
Автор

If the array is set a[5] at the beginning, how can you insert a sixth element into the array?

jaan
Автор

Sir position and index values are different things. I am getting confused position, index.

RITESHKUMAR-couf
Автор

In this program our main purpose to insert an element .
Why we replaced two element .
Can't we insert the element replace by that specific position that we required.
Sir please confirm me plz

rajendrasashamal
Автор

Sir, bere the size of aaray firstly is 5 . We know the size of aaray is static (we can't change it), but here in this program next time size become 6 and we print 6 elements..
How it's possible??

jagdishrathod
Автор

Sir u wrote array of size 5 but we are adding one more element to it we declared size 5 will it consider or should take big size and consider 5 elements??

medapatigaayathre