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

Using functions, write a program that multiplies two arrays. Use the following functions: - Function ReadArray - Function MultiplyArrays - Function DisplayArrays

1905


a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above

891


What is the usage of the pointer in c?

616


Does c have class?

625


Explain how do you override a defined macro?

598






Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

656


What is the use of getchar() function?

639


c programs are converted into machine language with the help of a) an interpreter b) a compiler c) an operatinf system d) none of the above

751


7-Given an index k, return the kth row of the Pascal's triangle. For example, when k = 3, the row is [1,3,3,1]. For reference look at the following standard pascal’s triangle.

2236


Does sprintf put null character?

611


What is the purpose of type declarations?

688


Can variables be declared anywhere in c?

632


What is function what are the types of function?

572


What is ctrl c called?

609


Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor

3005