#include <stdio.h>

int max(int arr[], int n)

{int i;

int max = arr[0];

for (i = 1; i < n; i++)

{if (arr[i] > max)

max = arr[i];}

return max;}

int min(int arr[], int n)

{int i;

int min=arr[0];

for (i=1;i<n;i++)

{if (arr[i]<min)

min = arr[i];}

return min;}

int main()

{ int numberofcollumns;

printf("enter the number of the collumns:\t");

scanf("%d",&numberofcollumns);

int arr[numberofcollumns];

int index;

for (int n=0;n<numberofcollumns;n++)

{printf("enter the next number of your array:\t");

scanf("%d",&index);

arr[n]=index;}

printf("Largest number in given array is :%d\n", max(arr, numberofcollumns));

printf("smallest number in given array is :%d", min(arr, numberofcollumns));

return 0;}

//this was my universityy class project