Initial Basics – Algebra – Problem #27

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

Difficulty: Medium

Problem Statement

Write a C Program that will read four integer values, find how may of them are unique and print only the unique elements in ascending order. For example, if the integers read in are 5, 8, 1,5 then you will first print that there are 3 unique elements and then print 1, 5, 8. Save the file as A02_<Roll Number>.c (example A02_21AG10002.c). Build, Run for and test it for the given data.Then upload the .c file for the Assignment. In particular, you will do the following: 1. Read in four integers and print them. 2. Print how many unique elements are there. 3. Print the unique elements in ascending order. Test Data: 1. 7, 1, 7, 1 2. 4, 4, 4, 2 3. 1, 5, 8, 2 4. 5, 5, 5, 5

Back to Lab Problems
Initial Basics/Algebra/Problem #27

Lab Problem Statement

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

Interactive C Compiler · Problem #27

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.