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
i got 75% in all semester am i eligible for your company
What is the function of this pointer?
What is the code in while loop that returns the output of given code?
What are the different types of data structures in c?
What is the c value paradox and how is it explained?
What is the total generic pointer type?
If i have an array 0 to 99 i.e,(Size 100) I place the values 1 to 100 randomly like a[0]=29,a[1]=56 upto array[99].. the values are only between 1 to 100. getting the array values by using scanf.. If i entered one wrong element value line a[56]=108. how can i find it.. and also how to find the missing value in 1 to 100.. and i want to replace the missing values.. any one of them know please post your answer..
Can a pointer be static?
What are pointers?
What are the different data types in C?
The performance of an operation in several steps with each step using the output of the preceding step a) recursion b) search c) call by value d) call by reference
Write a program to generate the Fibinocci Series
What is use of bit field?
Why doesnt this code work?
What is this infamous null pointer, anyway?