C program to find number of distinct elements in the array.I enclose the code tried by me. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

C program to find number of distinct elements in the array.I enclose the code tried by me.

https://code.sololearn.com/c7IFBjYES2nu/?ref=app

19th Feb 2019, 2:40 PM
Punnam Ruthvik Reddy
10 Answers
+ 3
https://code.sololearn.com/cEZiNSKuePxW/?ref=app Thank you *Asterisk *
19th Feb 2019, 4:16 PM
Punnam Ruthvik Reddy
+ 2
Ruthvik reddy Punnam something like this, you just have to print the size of the array and that solve your problem I think https://code.sololearn.com/cfQL7xwd5Va3/?ref=app
19th Feb 2019, 3:54 PM
✳AsterisK✳
✳AsterisK✳ - avatar
+ 1
What are you trying to achieve? I can't understand your question
19th Feb 2019, 3:12 PM
Maneren
Maneren - avatar
+ 1
Number of distinct elements Subtracting number of same elements from total number of elements
19th Feb 2019, 3:14 PM
Punnam Ruthvik Reddy
+ 1
No For example Input= 3 3 3 5 6 Output =3 Number of distinct elments (3 5 6) We should not consider duplicate elements *Asterisk*
19th Feb 2019, 3:50 PM
Punnam Ruthvik Reddy
0
show your code first, and i hope this is not an assignment
19th Feb 2019, 2:52 PM
✳AsterisK✳
✳AsterisK✳ - avatar
0
do you mean subtracting each element from the total numbers of elements Ruthvik reddy Punnam
19th Feb 2019, 3:43 PM
✳AsterisK✳
✳AsterisK✳ - avatar
0
OK
19th Feb 2019, 3:53 PM
✳AsterisK✳
✳AsterisK✳ - avatar
0
problem solved right Ruthvik reddy Punnam
19th Feb 2019, 4:20 PM
✳AsterisK✳
✳AsterisK✳ - avatar
0
you're welcome Ruthvik reddy Punnam
19th Feb 2019, 4:23 PM
✳AsterisK✳
✳AsterisK✳ - avatar