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

How main function is called in c?

616


What is strcmp in c?

586


What are unions in c?

568


a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list

617


Under what circumstances does a name clash occur?

678






What is an arrays?

642


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

765


What is the easiest sorting method to use?

625


Explain what is the difference between text files and binary files?

604


Is there any data type in c with variable size?

622


please explain every phase in the "SDLC" in the dotnet.

2165


Is stack a keyword in c?

624


how to construct a simulator keeping the logical boolean gates in c

1713


Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10

15025


What is the correct code to have following output in c using nested for loop?

601