Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. void insereaza(int &n, float x[], int k, float v)
  5. {
  6. int i;
  7. for(i=n; i>=k; i--)
  8. x[i+1]=x[i];
  9. x[k]=v;
  10. n++;
  11.  
  12. }
  13. int main()
  14. {
  15. int i, n=5;
  16. float x[1001]={0, 10, 20, 30, 40, 50};
  17. insereaza(n, x, 2, 67);
  18. for(i=1; i<=n; i++)
  19. cout<<x[i]<<" ";
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement