السلام عليكم ورحمة الله وبركاته
انا كاتب هذا الكود وشغال تمام لكن مشكلته بعد عملية العكس swap بقوم بطباعة أل عنصر
وهذا هو الكود والمشكله عندي في الاخير والله اعلم
#include <iostream.h>
int swap(int[], int count);
void main()
{
int x[] = {1, 59, 3, 9, 5, 8, 100};
cout<<" The array is : ";
for(int z=0; z<7;z++)
{
cout<<x[z]<<" ";
}
cout<<"\n\n the swap of array is : "<<swap(x, 6)<<"";
cout<<endl;
}
int swap(int y[], int count)
{
int i=0;
int j=count;
int temp=0;
if (i>j)
return 0;
return temp=y[j];
y[j]=y;
y=temp;
y[i+1];
y[j-1];
}