C Programming: Count unique digits of integers
37. Count Unique Digit Numbers Variants
Write a C program that counts the number of integers whose digits are unique from 1 and a given integer value.
Example:
Input: n = 30
From 1 to 30 all the integers have unique digits, except 11 and 22
Output: 28
Test Data:
(30) -> 28
(135) -> 110
Sample Solution:
C Code:
Sample Output:
Unique digits of integers from 1 and 135 = 110
Flowchart:

For more Practice: Solve these Related Problems:
- Write a C program to count numbers from 1 to n that have all unique digits using combinatorial methods.
- Write a C program to generate and count numbers with unique digits without converting them to strings.
- Write a C program to recursively determine if a number has unique digits and count how many do.
- Write a C program to list all numbers with unique digits in a given range and return the total count.
C Programming Code Editor:
Improve this sample solution and post your code through Disqus.
Previous: Count common factors of two integers.
Next: Count Integers with Odd digit sum.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.