SOURCE CODE:
#include<stdio.h>
#include<conio.h>
void main()
{
int a[5],n,i,small;
clrscr();
printf("Enter the total number of values:");
scanf("%d",&n);
for(i=0;i<n;i++)
{
printf("\nEnter a[%d]=",i);
scanf("%d",&a[i]);
}
small=a[0];
for(i=1;i<n;i++)
{
if(small>a[i])
small=a[i];
}
printf("\nSmallest Number is %d",small);
getch();
}
#include<conio.h>
void main()
{
int a[5],n,i,small;
clrscr();
printf("Enter the total number of values:");
scanf("%d",&n);
for(i=0;i<n;i++)
{
printf("\nEnter a[%d]=",i);
scanf("%d",&a[i]);
}
small=a[0];
for(i=1;i<n;i++)
{
if(small>a[i])
small=a[i];
}
printf("\nSmallest Number is %d",small);
getch();
}
No comments :
Post a Comment