Skip to content

Instantly share code, notes, and snippets.

@dertst
Last active November 7, 2018 13:51
Show Gist options
  • Save dertst/bed0afb2d6528d29810ccb02c31b0a15 to your computer and use it in GitHub Desktop.
Save dertst/bed0afb2d6528d29810ccb02c31b0a15 to your computer and use it in GitHub Desktop.
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