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 is c platform dependent?
what are enumerations in C
What is the meaning of 2d in c?
Can you please compare array with pointer?
What is the benefit of using const for declaring constants?
Draw a diagram showing how the operating system relates to users, application programs, and the computer hardware ?
What is time null in c?
Write a program to implement a round robin scheduler and calculate the average waiting time.Arrival time, burst time, time quantum, and no. of processes should be the inputs.
why we wont use '&' sing in aceesing the string using scanf
Write a C Program That Will Count The Number Of Even And Odd Integers In A Set using while loop
Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions?
How will you divide two numbers in a MACRO?
What is the difference between the local variable and global variable in c?
how we can make 3d venturing graphics on outer interface
hi folks i m approching for h1 b interview on monday 8th of august at montreal and i m having little problem in my approval notice abt my bithdate my employer has made a mistake while applying it is 12th january and istead of that he had done 18 the of january do any body have any solution for that if yes how can i prove my visa officer abt my real birthdate it urgent please let me know guys thaks dipesh patel