/*Write a C Program to implement dynamic array, find smallest and largest element of the
array*/
#include< stdio.h >
int main()
{
int *myarray,i,n,large,small;
printf(“\nEnter the number of elements : “);
scanf(“%d”,&n);
myarray=(int*)malloc(size * sizeof(int));
printf(“\nInput the array elements : “);
for(i=0;i< n;++i)
scanf(“%d”,&myarray[i]);
large=small=a[0];
for(i=1;i< n;++i)
{
if(a[i] > large)
large=myarray[i];
if(a[i]< small)
small=myarray[i];
}
printf(“\nThe smallest element is %d\n”,small);
printf(“\nThe largest element is %d\n”,large);
return 0;
}