how to find the kth smallest element in the given list of
array elemnts.

Answer Posted / sumesh

#include<stdio.h>
#include<conio.h>
void main()
{
int a[10],i,s,c=0; clrscr();
printf("enter the elements in the list :\n");
for(i=0;i<=9;i++)
{
scanf("%d",&a[i]);
}
s=a[0];
for(i=1;i<=9;i++)
{
if(s>a[i])
{
s=a[i];
c++;
break;
}
}
printf("small is\t %d\nfound on\t %d\n",s,c+1);
getch();
}

Is This Answer Correct ?    0 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

FILE *fp1,*fp2; fp1=fopen("one","w") fp2=fopen("one","w") fputc('A',fp1) fputc('B',fp2) fclose(fp1) fclose(fp2)} a.error b. c. d.

1196


What are local variables c?

545


Why does not c have an exponentiation operator?

624


Is c pass by value or reference?

593


Can you mix old-style and new-style function syntax?

659






What is FIFO?

668


How can I write functions that take a variable number of arguments?

620


What does 2n 4c mean?

708


any "C" function by default returns an a) int value b) float value c) char value d) a & b

660


Did c have any year 2000 problems?

648


What is the use of getch ()?

629


What is the process to generate random numbers in c programming language?

604


how do you execute a c program in unix.

634


How can type-insensitive macros be created?

692


How can this be legal c?

648