Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- void insertion(int array[],int n);
- void insertion(int array[],int n)
- {
- for(int i=0; i<n; i++)
- {
- int x=array[i];
- int j=i-1;
- while(j>=0 && array[j]>x)
- {
- array[j+1]=array[j];
- j--;
- }
- array[j+1]=x;
- }
- }
- int mani()
- {
- cout<<"how many number store in your array? ";
- int n;
- cin>>n;
- cout<<endl;
- int array[n];
- for(int i=0; i<n; i++)
- {
- cin>>array[i];
- }
- void insertion(int array,int n);
- for(int i=0; i<n; i++)
- {
- cout<<array[i]<<" ";
- }
- cout<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement