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 hash table in c?
Write a program to check palindrome number in c programming?
Why cant I open a file by its explicit path?
What is the collection of communication lines and routers called?
What are the types of assignment statements?
List some of the static data structures in C?
Is c still used?
Explain about C function prototype?
What is a structure and why it is used?
What are valid signatures for the Main function?
What is difference between structure and union in c?
What is variable initialization and why is it important?
How can I direct output to the printer?
plz let me know how to become a telecom protocol tester. thank you.
What is the modulus operator?