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

an expression contains relational operators, assignment operators, and arithmatic operstors. In the absence of parentheses, they will be evaluated in which of the following order a) assignment, relational, arithematic b) arithematic, relational, assignment c) relational, arithematic, assignment d) assignment, arithematic, relational

812


Can we replace the struct function in tree syntax with a union?

782


Write a program for finding factorial of a number.

635


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

814


Is c dynamically typed?

667






What are the different types of constants?

640


Explain the concept and use of type void.

630


How do I convert a string to all upper or lower case?

629


What is the meaning of ?

622


What is #include stdlib h?

616


What is the difference between array and pointer?

569


What is double pointer?

560


Array is an lvalue or not?

640


How do you use a 'Local Block'?

723


What is non linear data structure in c?

577