Generate all initial n numbers formed from 0 1 and 2
Given an size N, our goal is to print all positive number is consist 0,1 and 2s.
Example
Input : 50
Output :
0 1 2 10 11 12 20 21 22 100 101 102 110
111 112 120 121 122 200 201 202 210 211 212
220 221 222 1000 1001 1002 1010 1011 1012
1020 1021 1022 1100 1101 1102 1110 1111
1112 1120 1121 1122 1200 1201 1202 1210 1211
Here given code implementation process.
-
1) Initial n numbers formed by 0 1 and 2 in java
2) Initial n numbers formed by 0 1 and 2 in c++
3) Initial n numbers formed by 0 1 and 2 in golang
4) Initial n numbers formed by 0 1 and 2 in c#
5) Initial N numbers formed by 0 1 and 2 in vb.net
6) Initial N numbers formed by 0 1 and 2 in php
7) Initial N numbers formed by 0 1 and 2 in node js
8) Initial N numbers formed by 0 1 and 2 in typescript
9) Initial N numbers formed by 0 1 and 2 in python
10) Initial N numbers formed by 0 1 and 2 in ruby
11) Initial N numbers formed by 0 1 and 2 in scala
12) Initial N numbers formed by 0 1 and 2 in swift
13) Initial N numbers formed by 0 1 and 2 in kotlin
Please share your knowledge to improve code and content standard. Also submit your doubts, and test case. We improve by your feedback. We will try to resolve your query as soon as possible.
New Comment