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...

Write a program to find the smallest and largest element in
a given array in c language

Answer Posted / dally

#include<stdio.h>
int main()
{
int a[]= {4,3,6,7};
int l.n = 0;
int s.n = 9;
int i=0;
while(a[i] != '\0')
{
if(a[i]>= l.n)
l.n = a[i];
else if(a[i]<=s.n)
s.n = a[i]
i++;
}
printf("%d %d",s.n,l.n) ;

}

Is This Answer Correct ?    45 Yes 51 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of putchar function?

1007


Discuss the function of conditional operator, size of operator and comma operator with examples.

1097


simple program of graphics and their output display

1938


What is optimization in c?

948


What is meant by int main ()?

1154


Which is better pointer or array?

973


please can any one suggest me best useful video tutorials on c i am science graduate.please help me.u can email me to sas29@in.com

1722


all c language question

2377


What is the size of empty structure in c?

1017


Why do some versions of toupper act strangely if given an upper-case letter?

1037


How to implement a packet in C

2831


How many levels of indirection in pointers can you have in a single declaration?

1025


can any one tel me wt is the question pattern for NIC exam

1922


What are the parts of c program?

1040


how to construct a simulator keeping the logical boolean gates in c

2198