Inserting element at Specific Position in Array | C++ Programming

preview_player
Показать описание
Check the Entire Playlist

Function in C++

Loops in C++

Patterns in C++

Array in C++

Other Social Links

My name is Sumit and Welcome to our YouTube channel Edutainment 1.0 Here we will mix education with the entertainment to make education more easy to learn and understand.

-----------------------
Thank you so much
Рекомендации по теме
Комментарии
Автор

Thanks a lot was stuck at a program for so long. This helped fix a bug.

aliibraheem
Автор

Thanks alot ♥️♥️ Love the way when you said simply(isko aisey karrr dein geyy) it makes programming easier for us!

rabiadoll
Автор

Thank you so much sir. U r teaching me the things my college teacher couldn't teach me in year.

nehajaiswal
Автор

I watched lots of video on array insertion but I don't understand this now I understand insertion in array
Thanks ❤👅

manojrajput
Автор

Your Video helped me a lot. Thank you!

Uzairkhan-dvhz
Автор

THANK YOU SOO MUCH I HOPE YOU ARE SAFE AND HAPPY !!!

anirudhsharma
Автор

thankyou Ranveer Allahabadia for teaching me insertion

nezuko
Автор

All your videos are brilliant.. I have learnt a lot. Thank you very much

supriya.jogdanker
Автор

Can't understand his language but was able to understand the topic

hazellincons
Автор

Well explanation one of the best video on youtube thanks soo much

nasirkhan_
Автор

#include<iostream>
using namespace std;
int main(){
int a[5] = {1, 2, 3, 4, 5};
int position, num, i;

cout<<"enter the position and number "<<endl;
cin>>position>>num;

for (int i = 4; i >= position; i--)
{
a[i+1]=a[i];
}

a[position]=num;

cout<<"This is the new array after insert the new number"<<endl;
for (int i = 0; i <6; i=i+1)
{
cout<<a[i]<<endl;
}


return 0;
}


thank u somuch sir

nitishkumarmallick
Автор

The explanation seems clear, well done, but I do not master the English language, please add the subtitles file accompanying the video to the Arabic language, as some YouTube channels use and thank you.

aliqasim
Автор

yes i did understand it very quickly .. veery quickly

veskcompany
Автор

Generic code :-
#include<iostream>
using namespace std;
int main()
{
int array[100];
int position = 0, number = 0, n = 0;
cout << "how many values you want to enter : ";
cin >> n;
cout << "enter elements of array : "<<endl;
for (int i = 0; i < n; i++)
{
cin >> array[i];
}
cout << "enter position then number : ";
cin >> position >> number;//position is the index on which the number will be inserted
for (int i = n ; i >= position; i--)//it will run till the entered position
{
array[i + 1] = array[i];//it will shift the index to next index after position
}
array[position] = number;//assign number to position
for (int i = 0; i < n+1; i++)//display the array
{
cout << array[i]<<" ";
}
system("pause");
}

AbdulMoiz-koru
Автор

It is very helpful for me
thank you sir

vlogpeshawar
Автор

*Do index ka same value aa raha hai ?*

MP...
Автор

Sir plz explain kya logic for loop mean --i walya Ka nicha jab hum na number ko array ki position main insart Kar Diya ha to phir logic for loop Ka kya fada kya Ka for loop ko remove Kar Ka bi answer same arha ha

uzairshafiq
Автор

This was so easy, i wonder why my teacher made it seem so complicated.

aali-inlc
Автор

thank you so much sir aapne bcha liya fail hote hote

harshjoshi
Автор

are u using nested for here or single for for each???

SehrishSaif