Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

#include<stdio.

h>
#include<conio.h>
void main()
{
int small,i,n,pos;
int a[10];
printf("enter no.of elements:");
scanf("%d",&n);
printf("enter the elements:");
for(i=0;i<n;i++)
scanf("%d",&a[i]);
small=a[0];
for(i=0;i<n;i++)
{
if(a[i]<=small)
{
small=a[i];
pos=i;
}
}
printf("The smallest pos is:%d",pos);
getch();
}

You might also like