write a program to fined second smallest and largest element
in a given series of elements (without sorting)
Answer Posted / raj
#include <stdio.h>
void main()
{
int i, ar[] ={15,22,122,15,6,12};
int a,b= 0,c,ta ,tb, tc;
a =ar[0];
b = ar[1];
for (i = 0; i < 6 ;i++)
{
if(a > ar[i])
{
b = a;
a = ar[i];
}
else if(b > ar[i])
{
b = ar[i];
}
}
printf("\n %d ",b);
}
| Is This Answer Correct ? | 3 Yes | 3 No |
Post New Answer View All Answers
Explain the properties of union. What is the size of a union variable
to find the closest pair
Is c call by value?
How can this be legal c?
Is multithreading possible in c?
What is linear search?
int i=10; printf("%d %d %d", i, i=20, i);
Explain spaghetti programming?
Can you define which header file to include at compile time?
What are the 5 data types?
Tell me the use of bit field in c language?
Define Array of pointers.
Define Spanning-Tree Protocol (STP)
hi any body pls give me company name interview conduct "c" language only
What does *p++ do? What does it point to?