Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "pch.h"
- #include <iostream>
- #include <time.h>
- #define SIZE 12
- #define MIN_VALUE 0
- #define MAX_VALUE 100
- #define Random(min, max) (min + rand() % ((max + 1) - min))
- using namespace std;
- int main() {
- srand(time(NULL));
- int a[SIZE], b[3];
- int i, max = 0;
- for (i = 0; i < SIZE; i++)
- a[i] = Random(MIN_VALUE, MAX_VALUE);
- cout << "Source array: " << endl;
- for (i = 0; i < SIZE; i++)
- cout << " " << a[i];
- for (i = 0; i < SIZE; i++) {
- if (a[i] > max) max = a[i];
- }
- cout << max;
- return(0);
- }
Add Comment
Please, Sign In to add comment