![]() |
C Program to Calculate all possible Combinations of an n Digit Number
Generally a question is asked that if you have given n bits then print out all the possible binary numbers of n bit and so I will try to explain how to get that done. Please don't Copy Paste. Understand The logic because it is useful in other problems as well
for eg if n=1 then you can have 0 1 if n=2 then you can have 00 10 01 11 Similarly if n=3 then you can have 8 possible combination. In general for a n bit number you can have 2 to the power n possible numbers. :D Code:
#include <stdio.h> |
Re: C Program to Calculate all possible Combinations of an n Digit Number
thanks
|
Re: C Program to Calculate all possible Combinations of an n Digit Number
You can say thanks by clicking on the thanks button...
|
| All times are GMT +5.5. The time now is 00:56. |