Skip to content

Instantly share code, notes, and snippets.

@prodhan
Created March 24, 2019 13:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prodhan/53a7a6a3d30f5b71d8862d72b29d34da to your computer and use it in GitHub Desktop.
Save prodhan/53a7a6a3d30f5b71d8862d72b29d34da to your computer and use it in GitHub Desktop.
Insert into LA
#include <iostream>
using namespace std;
int main()
{
int LA[10]={4,20,8,2,7,6,3,48,62,75};
int n=10, k=5, j, item=100;
for (j = n - 1; j >= k - 1; j--)
{
LA[j+1] = LA[j];
}
LA[k] = item;
n=n+1;
cout<<"Resultant array is\n"<<endl;
for (j = 0; j < n; j++)
cout<<LA[j]<<"\t";
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment