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 use of integral promotions in c?

1139


Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.

2060


Why c is procedure oriented?

1061


What is huge pointer in c?

1071


Why can't I perform arithmetic on a void* pointer?

1089


WHAT IS THE DEFINATION OF IN TECHNOLOGY AND OFF TECHNOLOGY ?

2371


what is recursion in C

1058


Can we compile a program without main() function?

1115


What are global variables and how do you declare them?

1079


What is the need of structure in c?

1106


What is the size of a union variable?

1048


What is a pointer and how it is initialized?

1148


Why ca not I do something like this?

1007


Explain low-order bytes.

1026


Write a programme using structure that create a record of students. The user allow to add a record and delete a record and also show the records in ascending order.

2084