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 are high level languages like C and FORTRAN also known as?

1130


What is the value of h?

999


What do you know about the use of bit field?

1009


How can I call a function with an argument list built up at run time?

1192


Are enumerations really portable?

992


how can f be used for both float and double arguments in printf? Are not they different types?

1035


Why is c known as a mother language?

1200


What is use of bit field?

1257


What is abstract data structure in c?

998


Explain the difference between structs and unions in c?

980


What does node * mean?

1158


What is meant by errors and debugging?

1075


How can I insert or delete a line (or record) in the middle of a file?

994


Explain how can you restore a redirected standard stream?

1061


Why is c called c?

983