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 / azhar shaik

int n, i,small,a[30];
clrscr();
pf("enter the no.of elements in an array");
sf("%d",&n);
pf("enter the elements \n");
for(i=0;i<n;i++)
{
pf("a[%d]= ,"i);
sf("%d\n",&ai[i]);
}
pf(" displaty the array elements ");
for(i=0;i<n;i++)
{
pf("%d\t",a[i]);
}
pf("smallest element from an array "):
small=a[0];
for(i=1;i<n;i++)
{
if(small>a[i])
{
small=a[i];
}
pf("smallest element is %d ",small);
getch();
}


hint:pf =print f ,sf =scan f

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

i have to apply for rbi before that i need to know the the syllabus for the entrance questions. whethet it may be aps or techinical

2320


What are the different types of constants?

1075


Explain how can a program be made to print the name of a source file where an error occurs?

1191


How do you initialize pointer variables?

1091


What are the types of macro formats?

1113


What is the scope of local variable in c?

1120


Explain built-in function?

1127


Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;

1065


what is the height of tree if leaf node is at level 3. please explain

2147


Why do we use namespace feature?

1051


HOW TO SOLVE A NUMERICAL OF LRU IN OS ??????

2686


In a switch statement, what will happen if a break statement is omitted?

1059


Can you write the function prototype, definition and mention the other requirements.

1126


Lists the benefits of c programming language?

1130


What is the difference between new and malloc functions?

1118