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 / sathish

main()
{
int a[20],n,i,s;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
s=a[0];
for(i=0;i<n;i++)
{
if(s>a[i])
{
s=a[i];
}
}
printf("the smallest number is %d",s);
}

Is This Answer Correct ?    138 Yes 57 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between declaring a variable and defining a variable?

1290


What does volatile do?

988


Is flag a keyword in c?

1161


pgm to find number of words starting with capital letters in a file(additional memory usage not allowed)(if a word starting with capital also next letter in word is capital cann't be counted twice)

2349


What are formal parameters?

1131


What the advantages of using Unions?

1236


explain how do you use macro?

1167


Explain about the functions strcat() and strcmp()?

1061


What is extern keyword in c?

1138


What is #line?

1067


What are valid operations on pointers?

1212


Synonymous with pointer array a) character array b) ragged array c) multiple array d) none

1079


Device an algorithm for weiler-atherton polygon clipping, where the clipping window can be any specified polygon

5965


Explain what is the benefit of using enum to declare a constant?

1097


How many keywords are there in c?

1083