Source Code :
#include<stdio.h>
void main()
{
int a[10],*p,i,min;
clrscr();
printf("\nEnter 10 Elements : ");
for(i=0;i<10;i++,p++)
scanf("%d",p);
p=&a[0];
min=*p;
for(i=0;i<10;i++,p++)
if(*p<min)
min=*p;
printf("\nSmallest Element : %d",min);
getch();
}
Output :
Enter 10 Elements : 2 5 6 9 8 4 1 3 7 5
No comments:
Post a Comment