Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void insereaza(int &n, float x[], int k, float v)
- {
- int i;
- for(i=n; i>=k; i--)
- x[i+1]=x[i];
- x[k]=v;
- n++;
- }
- int main()
- {
- int i, n=5;
- float x[1001]={0, 10, 20, 30, 40, 50};
- insereaza(n, x, 2, 67);
- for(i=1; i<=n; i++)
- cout<<x[i]<<" ";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement