write a program to fined second smallest and largest element
in a given series of elements (without sorting)

Answer Posted / anand

include<stdio.h>
#include<conio.h>
void main()
{
int a[10],max,min,i,temp;
printf("\n enter array element");
for(i=0;i<10;i++)
{
scanf("%d",&a[i]);
}
//second smallest number
min=a[0];
for(i=0;i<10;i++)
{
if(min>a[i])
{
min=a[i];
}

Is This Answer Correct ?    4 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between abs() and fabs() functions?

864


Is there a way to have non-constant case labels (i.e. Ranges or arbitrary expressions)?

828


What is difference between class and structure?

839


What is the use of header?

836


What is #line used for?

785


What is c mainly used for?

824


How to Throw some light on the splay trees?

804


What are c header files?

783


What is assert and when would I use it?

776


cavium networks written test pattern ..

3819


How will you write a code for accessing the length of an array without assigning it to another variable?

826


How can I insert or delete a line (or record) in the middle of a file?

789


write a program which the o/p should b in such a way that s triangle if I/p is 3,a Square/rectangle if I/P=4,a pentagon if I/P=5 and so on...forget about the I/P which is less than 3

1858


What is function and its example?

899


What are near, far and huge pointers?

843