Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdlib.h>
- using namespace std;
- int main() {
- srand(time(NULL));
- int arr[5][5];
- int min, max;
- cout << "Enter min value of random range: ";
- cin >> min;
- cout << "Enter max value of random range: ";
- cin >> max;
- cout << "Our matrix:\n";
- for (int i = 0; i < 5; i++) {
- for (int j = 0; j < 5; j++) {
- arr[i][j] = min + rand() % (max - min + 1);
- cout << arr[i][j] << " ";
- }
- cout << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement