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 hash table in c?

1026


Write a program to check palindrome number in c programming?

1025


Why cant I open a file by its explicit path?

1039


What is the collection of communication lines and routers called?

1129


What are the types of assignment statements?

1072


List some of the static data structures in C?

1204


Is c still used?

1053


Explain about C function prototype?

1102


What is a structure and why it is used?

1230


What are valid signatures for the Main function?

1241


What is difference between structure and union in c?

995


What is variable initialization and why is it important?

1273


How can I direct output to the printer?

1324


plz let me know how to become a telecom protocol tester. thank you.

2192


What is the modulus operator?

1221