Skip to content

Develop a function that outputs all odd numbers in an increasing order followed by all even numbers in a decreasing order.

Notifications You must be signed in to change notification settings

SuXiFisherman/Sort-data-in-an-array

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Sort-data-in-an-array

Problem: Function and Sorting

Problem description:

• Write a program that accepts a sequence of integers. All the input values should be stored in an array. In this task, the maximum length of the sequence is 1000. Declare the array with an appropriate size accordingly.

• Develop a function that outputs all odd numbers in an increasing order followed by all even numbers in a decreasing order. Users will use -999 to indicate the end of input. Sample inputs and outputs are as follows.

• Sample Input and Output 1:

Enter a sequence of integer (-999 to finish): 1 2 3 4 5 6 7 8 9 -999

1 3 5 7 9 8 6 4 2

• Sample Input and Output 2:

Enter a sequence of integer (-999 to finish): 1 2 3 4 5 -999

1 3 5 4 2

About

Develop a function that outputs all odd numbers in an increasing order followed by all even numbers in a decreasing order.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages