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

A program is required to print your biographic information including: Names, gender, student Number, Cell Number, line of study and your residential address.

1496


What is NULL pointer?

886


can we implement multi-threads in c.

904


Explain two-dimensional array.

847


Can we declare variable anywhere in c?

749


Do array subscripts always start with zero?

1037


Why static is used in c?

851


How to explain the final year project as a fresher please answer with sample project

742


What are header files? What are their uses?

858


develop algorithms to add polynomials (i) in one variable

1961


Does c have class?

877


Write a program of prime number using recursion.

846


What are the different data types in C?

966


Explain what are preprocessor directives?

842


Explain the red-black trees?

840