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

Answer Posted / mohit kumar

#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 ?    20 Yes 39 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does the c in ctime mean?

654


Where are the auto variables stored?

731


Can static variables be declared in a header file?

716


What does typedef struct mean?

771


What are the various types of control structures in programming?

703






Difference between MAC vs. IP Addressing

727


What is wrong with this declaration?

709


difference between object file and executable file

6198


What is the size of a union variable?

685


What do the functions atoi(), itoa() and gcvt() do?

813


What is c mainly used for?

706


what do you mean by enumeration constant?

686


Difference between strcpy() and memcpy() function?

775


Explain what happens if you free a pointer twice?

703


What is a pointer value and address in c?

725