# Contains? & ltstdio.h & gt
# Definition? n? 10? //Number of array elements
//bubble sorting
int? Master ()
{
int? t,num[N];
int? I,j,d;
int? max
Printf ("Please enter %d numbers separated by spaces: \n", n);
for(I = 0; I & ltn;; i++)
{
scanf("%d ",& ampnum[I]);
}
Printf ("Please enter the maximum value: \ n");
scanf("%d ",& ampd);
for(I = 0; I & ltn;; The core of i++)// program is double nesting.
{
for(j = 0; j & ltn; j++)
{
//if(num[j]& gt; Num[j+ 1])// Arranged from small to large
if(num[j]& lt; num[j+ 1])? //Arranged from largest to smallest
{
t = num[j]; //exchange position
num[j]= num[j+ 1];
num[j+ 1]= t; ?
}?
}
}
Printf ("The data is sorted as follows: \ n");
for(I = 0; I & ltn;; I++)// Output the sorted array elements.
{
printf("%d?" ,num[I]);
}
Printf ("\ nThe value to be queried is: %d\n", num [d-1]);
System ("suspended"); //Pause function
Return? 0;
}