Last active
November 7, 2018 13:51
-
-
Save dertst/bed0afb2d6528d29810ccb02c31b0a15 to your computer and use it in GitHub Desktop.
This file contains 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
void vvod(int arr[], int n) | |
{ | |
printf("vvedite chiclo elementov:"); | |
scanf_s("%d", &n); | |
printf("vvedite elementy:"); | |
for (int i = 0; i < n; i++) | |
{ | |
scanf_s("%d", &arr[i]); | |
} | |
} | |
void max(int arr[], int n) | |
{ | |
int max = arr[0]; | |
for (int i = 0; i < n; i++) | |
{ | |
if (arr[i] > max) | |
{ | |
max = arr[i]; | |
} | |
} | |
printf("%d ", max); | |
} | |
void min(int arr[], int n) | |
{ | |
int min = arr[0]; | |
for (int i = 0; i < n; i++) | |
{ | |
if (arr[i] < min) | |
{ | |
min = arr[i]; | |
} | |
} | |
printf("%d ", min); | |
} | |
int main() | |
{ | |
int n; | |
int arr[100]; | |
vvod(arr, n); | |
max(arr, n); | |
min(arr, n); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment