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
What is the difference between abs() and fabs() functions?
Is there a way to have non-constant case labels (i.e. Ranges or arbitrary expressions)?
What is difference between class and structure?
What is the use of header?
What is #line used for?
What is c mainly used for?
How to Throw some light on the splay trees?
What are c header files?
What is assert and when would I use it?
cavium networks written test pattern ..
How will you write a code for accessing the length of an array without assigning it to another variable?
How can I insert or delete a line (or record) in the middle of a file?
write a program which the o/p should b in such a way that s triangle if I/p is 3,a Square/rectangle if I/P=4,a pentagon if I/P=5 and so on...forget about the I/P which is less than 3
What is function and its example?
What are near, far and huge pointers?