#include <iostream>
using namespace std;
int main() {
int arr[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
int temp = arr[0];
arr[0] = arr[9];
arr[9] = temp;
for (int i = 0; i < 10; i++) {
cout << arr[i] << " ";
}
return 0;
Copyright © 2025 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
#include <iostream>
using namespace std;
int main() {
int arr[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
int temp = arr[0];
arr[0] = arr[9];
arr[9] = temp;
for (int i = 0; i < 10; i++) {
cout << arr[i] << " ";
}
return 0;
}