Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- #include <time.h>
- #include <stdio.h>
- void monitor(int *p);
- /////////////////////////////////
- int main() //
- {
- srand(time(0));
- int array[20],
- nx,
- ng;
- for(int i = 0; i < 20; i++)
- {
- array[i] = rand()%200;
- }
- monitor(array);
- ng = array[0];
- for(int i = 0; i < sizeof(array)/4; i++ )
- {
- if (array[i] > nx) nx = array[i];
- }
- printf("min array: %d\n", ng);
- printf("max array: %d\n", nx);
- return 0;
- }
- /////////////////////////////////////////////////////
- void monitor(int *p) //
- {
- for(int i = 0; i < 20; i++)
- {
- printf("%d\n", p[i]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement