Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

program to find a smallest number in an array

Answer Posted / rose

#include<stdio.h>
#include<conio.h>
void main()
{
int n,a[50],temp;
printf("enter the max limit :");
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",&a[i]);
i=0;
for(j=0;j<n-1;j++)
{
if(a[j+1]<a[j])
{
temp=a[j+1];
a[j+1]=a[j];
a[j]=temp;
}
}
printf("the smnallest is : %d",*(a+0));
getch();
}

Is This Answer Correct ?    19 Yes 15 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why doesn't C support function overloading?

2610


Explain 'bit masking'?

1025


What are control structures? What are the different types?

1039


Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]

1022


Can stdout be forced to print somewhere other than the screen?

1014


List the different types of c tokens?

1010


What are header files in c?

1021


What are the two forms of #include directive?

1100


How to write c functions that modify head pointer of a linked list?

935


When should a type cast not be used?

1005


What is use of pointer?

1011


What is use of null pointer in c?

959


What is the difference between array and linked list in c?

1083


What are categories used for in c?

1035


What is the right way to use errno?

1003