Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Is a house a shell structure?

1125


Explain the difference between malloc() and calloc() in c?

1018


What is the difference between volatile and const volatile?

949


write a c program to find the largest and 2nd largest numbers from the given n numbers without using arrays

2199


Write a program to reverse a given number in c?

999


What is the difference between union and anonymous union?

1265


What are file streams?

978


Where does the name "C" come from, anyway?

1098


Explain the Difference between the New and Malloc keyword.

1097


What is scanf_s in c?

1075


What is the purpose of & in scanf?

1026


What are the difference between a free-standing and a hosted environment?

1244


What is the use of function in c?

1161


Is javascript based on c?

1019


What are the parts of c program?

1059