Array and Strings – Algebra – Problem #8

IIT Kharagpur CS10001 / CS11001 Programming and Data Structures Lab Question Archive

Difficulty: easy

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.

Back to Lab Problems
Array and Strings/Algebra/Problem #8

Lab Problem Statement

Specifications & Problem DetailsIIT Kharagpur PDS Archive
Loading question...

Interactive C Compiler · Problem #8

WASM In-Browser

Runs directly on your machine · Zero remote server dependency

Compiler downloads on first Run (large, saved in your browser after that)
main.cCtrl + Enter to run
1
2
3
4
5
6
7
Input (stdin)given to scanf / cin
Output

Output appears here. Press Run to compile and execute.