this is solution in c . I have first sorted the array then solved it using simple logics . suggestions are welcome .
include
int sort(int A[] , int n );
int min(int A[] , int n);
int main()
{
int A[30];
int a , i , s;
printf("enter the number of elements you want to enter");
scanf("%d" ,&a);
this is solution in c . I have first sorted the array then solved it using simple logics . suggestions are welcome .
include
int sort(int A[] , int n );
int min(int A[] , int n);
int main()
{
int A[30];
int a , i , s;
printf("enter the number of elements you want to enter");
scanf("%d" ,&a);
}
int sort(int A[] , int n )
{
int i;
int temp , j;
for(i=0;i<n;i++)
{
for(j=i+1;j<n;j++)
{
if(A[j]<A[i])
{
temp=A[i];
A[i]=A[j];
A[j]=temp;
}
}
}
}
int min(int A[] ,int n)
{
int s , j=0 , k , i , l=1;
}