C++ code to print all 4 digit numbers with exactly two zeroes.
Answers
Answered by
1
Given number of digits n, print all n-digit numbers whose sum of digits adds upto given sum. Solution should not consider leading 0’s as digits.
Examples:
Input: N = 2, Sum = 3
Output: 12 21 30
Input: N = 3, Sum = 6
Output: 105 114 123 132 141 150 204
213 222 231 240 303 312 321
330 402 411 420 501 510 600
Input: N = 4, Sum = 3
Output: 1002 1011 1020 1101 1110 1200
2001 2010 2100 3000
suniltty180:
hello saumya
Similar questions