Saturday, June 29, 2013

Write a program to find the smallest no in given array ?

Program:
#include<stdio.h>
#include<conio.h>

void main()
{
int no[100],i,n,high=
32767;//maximum possible value in signed integer
clrscr();
printf("\n enter the no of no ");
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&no[i]);
if(high>no[i])
high=no[i];
}

printf("\n the %d  is smaller",high);
getch();
}

Output:
image



Like the Post? Do share with your Friends.

No comments:

Post a Comment