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

Write a program to swap two numbers without using a temporary variable?

611


in ‘C’ language for Matrix Multiplication fails” Introspect the causes for its failure and write down the possible reasons for its failure.

7410


Explain what will the preprocessor do for a program?

605


Can math operations be performed on a void pointer?

589


What is the meaning of c in c language?

596






How are structure passing and returning implemented?

592


What is the use of typedef in structure in c?

546


What are the types of data files?

729


What is the condition that is applied with ?: Operator?

665


What is clrscr ()?

638


Explain how can you be sure that a program follows the ansi c standard?

865


Who is the main contributor in designing the c language after dennis ritchie?

553


What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?

746


What are valid signatures for the Main function?

701


What do you understand by normalization of pointers?

627