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
Explain how can I avoid the abort, retry, fail messages?
PLS U SENS ME INTERVIEW O. MY EMAIL ADD, SOFIYA.SINGH@GMAIL.COM
Why is c called "mother" language?
What are qualifiers?
A c program to display count values from 0 to 100 and flash each digit for a secong.reset the counter after it reaches 100.use for loop,. pls guys hepl me.. :(
What are the keywords in c?
Hi can anyone tell what is a start up code?
A float occupies 4 bytes in memory. How many bits are used to store exponent part? since we can have up to 38 number for exponent so 2 ki power 6 6, 6 bits will be used. If 6 bits are used why do not we have up to 64 numbers in exponent?
How can I write a function that takes a format string and a variable number of arguments?
What does a derived class inherit from a base class a) Only the Public members of the base class b) Only the Protected members of the base class c) Both the Public and the Protected members of the base class d) .c file
Why do we use stdio h and conio h?
Differentiate abs() function from fabs() function.
Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.
What is difference between %d and %i in c?
When would you use a pointer to a function?