Printing 0 in the beginning of the sorted array and not printing the last element

Code:

int main()
{
int n;
cout<<“Enter no. of elements:”;
cin>>n;
int a[1000];

cout<<"Enter elements in the array:";
 
 for(int i=0;i<n;i++)
 {
 	cin>>a[i];
 }
 bubble_sort(a,n);
 cout<<"\n sorted array:";
 for(int i=0;i<n;i++)
 {
 	cout<<a[i];
 	cout<<"  ";
 }
  
 return 0;

}

hello @janhavisinghbv37642865

this code is incomplete.
pls save ur complete code at cb ide and share its link with me

In line 8 start i from 1