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
which of the following is not a character constant a) 'thank you' b) 'enter values of p, n ,r' c) '23.56E-o3' d) all of the above
explain what is fifo?
What is calloc malloc realloc in c?
Explain the difference between call by value and call by reference in c language?
Is it possible to use curly brackets ({}) to enclose single line code in c program?
How to write a code for implementing my own printf() and
scanf().... Please hep me in this... I need a guidance...
Can you give an coding for c... Please also explain about
the header files used other than #include
What is the size of empty structure in c?
can anyone please tell about the nested interrupts?
`write a program to display the recomended action depends on a color of trafic light using nested if statments
What does double pointer mean in c?
Why flag is used in c?
Why clrscr is used after variable declaration?
What is structure data type in c?
Why void main is used in c?
What is the use of volatile?