Array and Strings – Algebra – Problem #8
IIT Kharagpur CS10001 / CS11001 Programming and Data Structures Lab Question Archive
Problem Statement
Consider an integer array of size 10. The array contains integer numbers from 1 to 200. Write a C program that (a) Declares the array and asks the user to enter 10 integer numbers in between 1 and 200 (inclusive those). Once the user enters 10 integer numbers within the range, the array is populated with those numbers. (b) Rearrange the numbers of the array elements as follows. You should not use any additional array for this. - The numbers less than 100 (including 100) are kept first, these numbers are sorted in the increasing order - The numbers greater than 100 are kept next, these numbers are sorted in the decreasing order (c) Print the output array after rearranging the elements.