This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| using namespace std; | |
| int main() { | |
| const int SIZE = 50; | |
| int array1[SIZE], array2[SIZE]; | |
| int insertionIterations = 0, shellIterations = 0; | |
| srand(time(0)); | |
| for (int i = 0; i < SIZE; i++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| using namespace std; | |
| int main() { | |
| const int SIZE = 10; | |
| int arr[SIZE]; | |
| cout << "Enter " << SIZE << " array elements:" << endl; | |
| for (int i = 0; i < SIZE; i++) { | |
| cin >> arr[i]; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| using namespace std; | |
| int main() { | |
| int size; | |
| cout << "Enter array size: "; | |
| cin >> size; | |
| if (size <= 0) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| int main() { | |
| const int SIZE = 15; | |
| int arr[SIZE]; | |
| std::cout << "Array: "; | |
| for (int i = 0; i < SIZE; ++i) { | |
| arr[i] = std::rand() % 100 + 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| int main() { | |
| int size; | |
| std::cout << "Enter array size: "; | |
| std::cin >> size; | |
| if (size <= 0) { | |
| std::cerr << "The array size must be positive." << std::endl; | |
| return 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| int main() { | |
| const int SIZE = 10; | |
| int arr[SIZE]; | |
| std::cout << "Enter 10 integers: "; | |
| for (int i = 0; i < SIZE; ++i) { | |
| std::cin >> arr[i]; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| int main() { | |
| const int SIZE = 17; | |
| int arr[SIZE]; | |
| std::cout << "Enter 17 two-digit integers: "; | |
| for (int i = 0; i < SIZE; ++i) { | |
| std::cin >> arr[i]; | |
| if (arr[i] < 10 || arr[i] > 99) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1) | |
| #include <iostream> | |
| using namespace std; | |
| int main() { | |
| int rows, cols, start; | |
| cout << "Enter the number of rows: "; | |
| cin >> rows; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1) | |
| #include <iostream> | |
| using namespace std; | |
| int main() { | |
| const int ROWS = 3; | |
| const int COLS = 3; | |
| int arr[ROWS][COLS]; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| using namespace std; | |
| int main() { | |
| const int rows = 3, cols = 4; | |
| int arr[rows][cols] = { | |
| {3, 5, 6, 7}, | |
| {12, 1, 1, 1}, | |
| {0, 7, 12, 1} | |
| }; |