C program that sort a list of number in non-ascending order and print the midpoint of the list
Posted by Samath
Last Updated: June 01, 2015

Write a C program that receives 11 float numbers of three significant figures from the console. Sort it in non-ascending order and print the midpoint of the list.

Solution:

```#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
float nums[11],temp;

for(int i=0;i<11;i++)
{
printf("Enter num: ");
scanf("%f",&nums[i]);
}

for(int i=11;i>=0;i--)
{
for(int k=11;k>=0;k--)
{
if(nums[i]<nums[k])
{
temp=nums[i];
nums[i]=nums[k];
nums[k]=temp;
}
}
}

printf ("Middle Point is %.2f\n",nums[5]);

return 0;
}
```

How can you sort a list of tuples by the second element in Python?
DavidLee | Aug 14, 2024
How can you sort a list of strings by their length using Python?
AliceWk | Aug 21, 2024
JavaScript program that sort an array of integers in ascending order
SceDev | Feb 17, 2024
How can you sort results in ascending or descending order in SQL?
LeoRobs | Jun 12, 2024
Linked List in C++
Samath | Jan 07, 2021
Samath | Jan 07, 2021
How to create a linked list using C++
Samath | Jan 04, 2017
Python getting a List of Keys in a Dictionary
Samath | Jan 13, 2017
How do you list all stashes?
HenryPk | Jul 08, 2024
Write a Python function to find the median of a list.
TinaGrn | Aug 15, 2024
Write a Python function to find the mode of a list.
SamPetr | Aug 25, 2024
How can you generate a list of prime numbers up to n in Python?
TinaGrn | Aug 23, 2024
Write a Python function to find the second smallest element in a list.
AliceWk | Aug 10, 2024
How can you find the sum of elements in a list using list comprehension in Python?
DavidLee | Aug 20, 2024