LEVEL: Beginner
Whats in this post?
- Code
- Output
- Background and Explanation of the code
- Download Code
Code
To copy code: Click “View Source” on the right of this code snippet.
Background and Explanation of the code

Therefore , a[0] = 0, a[1] = 1,. . . . . . a[5] = 1
then we print the elements of array in reverse order and get the result.
Output:
Enter the decimal number : 62 (Press Enter)
The binary equivalent is: 111110