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
What does the c in ctime mean?
Where are the auto variables stored?
Can static variables be declared in a header file?
What does typedef struct mean?
What are the various types of control structures in programming?
Difference between MAC vs. IP Addressing
What is wrong with this declaration?
difference between object file and executable file
What is the size of a union variable?
What do the functions atoi(), itoa() and gcvt() do?
What is c mainly used for?
what do you mean by enumeration constant?
Difference between strcpy() and memcpy() function?
Explain what happens if you free a pointer twice?
What is a pointer value and address in c?