C Program to find smallest number in an array - c programs
//C Program to find smallest number in an array
#include <stdio.h>
#include <conio.h>
main()
{
int a[10],i,small;
clrscr();
printf("enter the numbers in an array");
for(i=0;i<10;i++)
scanf(%d%d%d",&a[i]);
small=a[0];
for(i=0;i<n;i++)
{
if(small>a[i])
{
small=a[i];
}
}
printf("the smallest number is ",small);
}
}
#include <conio.h>
main()
{
int a[10],i,small;
clrscr();
printf("enter the numbers in an array");
for(i=0;i<10;i++)
scanf(%d%d%d",&a[i]);
small=a[0];
for(i=0;i<n;i++)
{
if(small>a[i])
{
small=a[i];
}
}
printf("the smallest number is ",small);
}
}
No comments:
Post a Comment