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
What is use of integral promotions in c?
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.
Why c is procedure oriented?
What is huge pointer in c?
Why can't I perform arithmetic on a void* pointer?
WHAT IS THE DEFINATION OF IN TECHNOLOGY AND OFF TECHNOLOGY ?
what is recursion in C
Can we compile a program without main() function?
What are global variables and how do you declare them?
What is the need of structure in c?
What is the size of a union variable?
What is a pointer and how it is initialized?
Why ca not I do something like this?
Explain low-order bytes.
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.