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
Is a house a shell structure?
Explain the difference between malloc() and calloc() in c?
What is the difference between volatile and const volatile?
write a c program to find the largest and 2nd largest numbers from the given n numbers without using arrays
Write a program to reverse a given number in c?
What is the difference between union and anonymous union?
What are file streams?
Where does the name "C" come from, anyway?
Explain the Difference between the New and Malloc keyword.
What is scanf_s in c?
What is the purpose of & in scanf?
What are the difference between a free-standing and a hosted environment?
What is the use of function in c?
Is javascript based on c?
What are the parts of c program?