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
Why string is used in c?
What is a rvalue?
What is the difference between array and linked list in c?
Is python a c language?
Why do we need a structure?
What does int main () mean?
what are the 10 different models of writing an addition program in C language?
What are the header files used in c language?
int far *near * p; means
Can stdout be forced to print somewhere other than the screen?
What is a function in c?
What is the difference between procedural and functional programming?
Can you return null in c?
What is sizeof return in c?
Explain how do I determine whether a character is numeric, alphabetic, and so on?