Array and Strings – Algebra – Problem #13

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

Difficulty: medium

Problem Statement

Read an integer n (< 100). Input an integer array A[] of n elements from the user. The array can have multiple occurrences of elements. You have to remove the multiple occurrences of elements and store the distinct elements in a new array. The memory for the new array has to be dynamically allocated using malloc such that its size is same as the number of distinct elements in A[].

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

Lab Problem Statement

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

Interactive C Compiler · Problem #13

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.