Created
March 24, 2019 13:10
-
-
Save prodhan/53a7a6a3d30f5b71d8862d72b29d34da to your computer and use it in GitHub Desktop.
Insert into LA
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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