how to find the kth smallest element in the given list of
array elemnts.
Answer Posted / shil
#include <stdio.h>
#include<conio.h>
main()
{
int a[20], i,n;
printf("ent how many elements u want to enter");
scanf("%d",&n);
printf("enter the elements");
for(i=1;i<=n;i++)
scanf("%d",&a[i]));
s=a[1];
for(i=2;i<=n;i++)
{
if
{
s>a[i]
s=a[i]
}
}
printf("the smallest element is %d",s);
}
hope this correct if it is wrong plz let me know
| Is This Answer Correct ? | 19 Yes | 60 No |
Post New Answer View All Answers
State the difference between x3 and x[3].
What is a pragma?
What is external variable in c?
What are integer variable, floating-point variable and character variable?
Explain what are binary trees?
Explain the binary height balanced tree?
What are variables c?
Explain what is the benefit of using enum to declare a constant?
Sir i need notes for structure,functions,pointers in c language can you help me please
Explain the properties of union. What is the size of a union variable
Is printf a keyword?
an expression contains relational operators, assignment operators, and arithmatic operstors. In the absence of parentheses, they will be evaluated in which of the following order a) assignment, relational, arithematic b) arithematic, relational, assignment c) relational, arithematic, assignment d) assignment, arithematic, relational
Why & is used in scanf in c?
How will you delete a node in DLL?
a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none