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 the use of putchar function?
Discuss the function of conditional operator, size of operator and comma operator with examples.
simple program of graphics and their output display
What is optimization in c?
What is meant by int main ()?
Which is better pointer or array?
please can any one suggest me best useful video tutorials on c i am science graduate.please help me.u can email me to sas29@in.com
all c language question
What is the size of empty structure in c?
Why do some versions of toupper act strangely if given an upper-case letter?
How to implement a packet in C
How many levels of indirection in pointers can you have in a single declaration?
can any one tel me wt is the question pattern for NIC exam
What are the parts of c program?
how to construct a simulator keeping the logical boolean gates in c