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

#include<iostream.h>
#include<conio.h>
void main()
{
int a[20],n,i,s;
clrscr();
cout<<"Enter valur of n";
cin>>n;
cout<<"Enter the elements";
for(i=0;i<n;i++)
{
cin>>a[i];
}
s=a[0];
for(i=0;i<n;i++)
{
if(s>a[i])
{
s=a[i];
}
}
cout<<"The smallest number is"<<s
getch();
}

Is This Answer Correct ?    10 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between new and malloc functions?

1141


What is advantage of pointer in c?

1198


How can you convert integers to binary or hexadecimal?

1044


Explain what are header files and explain what are its uses in c programming?

1166


Are the variables argc and argv are local to main?

1325


What are the types of bitwise operator?

1125


Why are all header files not declared in every c program?

1112


What is bin sh c?

1051


What is 2c dna?

1093


What are directives in c?

983


Can a void pointer point to a function?

1035


What is structure in c definition?

1064


I heard that you have to include stdio.h before calling printf. Why?

1080


What is the newline escape sequence?

1083


What is an endless loop?

1287