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

When the macros gets expanded?

767


Explain what does the characters 'r' and 'w' mean when writing programs that will make use of files?

738


Is it better to bitshift a value than to multiply by 2?

641


Q.1 write aprogram to stack using linklist o insert 40 items? Q.2 write a program to implement circular queue with help of linklist?

1587


What are 3 types of structures?

577






FORMATTED INPUT/OUTPUT functions are a) scanf() and printf() b) gets() and puts() c) getchar() and putchar() d) all the above

606


What are linked lists in c?

635


What is default value of global variable in c?

549


write a programe to accept any two number and check the following condition using goto state ment.if a>b,print a & find whether it is even or odd and then print.and a

1440


Why main is used in c?

573


Explain how do you sort filenames in a directory?

594


When was c language developed?

685


Why does this code crash?

602


What is the difference between int main and void main?

562


Why header file is used in c?

560