Read five positive number using array find least among them

//read five positive number using array find least among them

#include<stdio.h>
#include<conio.h>
main()
{
int i,num[5],least;
for(i=0;i<5;i++)
{
printf("Input positive numbers");
scanf("%d",&num[i]);

}
least=num[0];
for(i=0;i<5;i++)
{
if(num[i]<least)
{
least=num[i];

}

}
printf("Least number=%d",least);
getch();
}

Leave a Reply

Your email address will not be published. Required fields are marked *

Enter Captcha Here : *

Reload Image