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
how is the examination pattern?
What are header files and what are its uses in C programming?
Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
How can you call a function, given its name as a string?
When should you use a type cast?
What is difference between %d and %i in c?
Why void main is used in c?
Can you define which header file to include at compile time?
What is array in c with example?
What is pivot in c?
1) There is a singing competition for children going to be conducted at a local club. Parents have been asked to arrive at least an hour before and register their children’s names with the Program Manager. Whenever a participant registers, the Program Manager has to position the name of the person in a list in alphabet order. Write a program to help the Program Manager do this by placing the name in the right place each time the Program Manger enters a name. 2) the Event Manager has to send participants to the stage to perform in the order in which they registered. Write a program that will help the Event Manager know who to call to the stage to perform. The Logic should be in Data Structures
Write a program of advanced Fibonacci series.
Write a program to print "hello world" without using a semicolon?
a construct the"else" part of "if" statement contains anoth "if else" statement is called a) if-else b) else-if-else c) if-else-if-else d) chain if/if-else-if
What are different types of variables in c?