C Program to find Smallest of N Number

C, C++, etc Programing examples. Post as many you can. Test the programs and discuss about the output of the programes.
Forum rules
Please Discuss & post only about the programes and its Output

C Program to find Smallest of N Number

Postby karthick_l » Sat Dec 18, 2010 6:43 pm

/* C Program to find Smallest of N Number */

#include<stdio.h>
#include<conio.h>
main()
{
int a[30],n,k,i;
clrscr();
printf("\\Program to find smallest of N numbers\\ \n");
printf("Enter N value to get numbers:");
scanf("%d",&n);
printf("Enter the value to find the smallest of N:%d numbers \n",n);
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
k=a[0];
for(i=0;i<n;i++)
if(a[i]<=k)
k=a[i];
printf("The smallest of N:%d number is: %d",n,k);
getch();
}

OUT put

\Program to find smallest of N numbers\
Enter N value to get numbers:10
Enter the value to find the smallest of N:10 numbers
345
67
762
109
56
567
2
987
786
542
The smallest of N:10 number is: 2
Regards
Karthick Loganathan
User avatar
karthick_l
Moderator
 
Posts: 7
Joined: Sat Dec 11, 2010 9:31 pm
membership: NA

ad
 

Re: C Program to find Smallest of N Number

Postby praveen » Mon Nov 28, 2011 8:48 pm

Thanks Karthick
Regards,
Praveen
AMIE Study

ImageImage
-------------------------------------------------------------------------------------------
AMIE Online Coaching
User avatar
praveen
Site Admin
 
Posts: 1008
Joined: Thu Oct 23, 2008 1:42 pm
Location: Mumbai
membership: Senior Technician of The Institution of Engineers (India)- ST


Return to Computer Notes : Some Sample Programs

Who is online

Users browsing this forum: No registered users and 0 guests