diff options
Diffstat (limited to 'progs/a396.py')
-rw-r--r-- | progs/a396.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/progs/a396.py b/progs/a396.py new file mode 100644 index 0000000..0d03f17 --- /dev/null +++ b/progs/a396.py @@ -0,0 +1,10 @@ +def decimal_To_Binary(N):
+ B_Number = 0
+ cnt = 0
+ while (N != 0):
+ rem = N % 2
+ c = pow(10,cnt)
+ B_Number += rem*c
+ N //= 2
+ cnt += 1
+ return B_Number
\ No newline at end of file |