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 is the use of the function in c?

796


How can you increase the size of a dynamically allocated array?

915


What are the advantages and disadvantages of c language?

769


Do you know null pointer?

780


What are the types of bitwise operator?

853


write a program that reads lines(using getline), converts each line to an integer using atoi, and computes the average of all the numbers read. also compute the standard deviation.

2222


What is the difference between near, far and huge pointers?

830


Who invented bcpl language?

934


What is && in c programming?

899


What is 1f in c?

2301


What does %c mean in c?

852


If fflush wont work, what can I use to flush input?

848


What is the -> in c?

790


Explain how do you list a file’s date and time?

806


The number of measuring units from an arbitarary starting point in a record,area,or control block to some other point a) recording pointer b) offset c) branching d) none

980