Can i make this code to containe squere matrix in cpp void sort(int arr[], int n){ for (int i=0; i


Can i make this code to containe squere matrix in cpp




void sort(int arr[], int n){
for (int i=0; i
if (arr[i]&1){
arr[i]*=-1;
}
}
sort(arr,arr+n);


for (int i=0; i
if (arr[i]&1){
arr[i]*=-1;
}
}
}


int main{


int arr[]={79,10,89,66,67};
int n=sizeof(arr)/sizeof(int);
sort(arr,n);


cout<"\nthe numbers:="">
for(int i=0; i
cout<><">
}
cout<>


cout<"\neven numbers="" in="" ascending="" order:="">
for (int i=0; i
if(arr[i]%2==0){
cout <><">
}
}
cout<>


cout<"odd numbers="" in="" descending="" order:="">
for (int i=0; i
if(arr[i]%2!=0){
cout<><">
}
}


}



Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here