Run Code
|
Code Wall
|
Users
|
Misc
|
Feedback
|
About
|
Login
|
Theme
WAP in C to convert decimal to binary
//gcc 5.4.0 #include <stdio.h> int main(void) { long num, dv= 6, rem, n=0, base=1, bv=0; num = dv ; while (num > 0) { rem = num % 2; if (rem == 1 ) { n++; } bv = bv + rem * base; num = num / 2; base = base*10; } printf ("%ld",bv); }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
address extraction
Even odd program
If Statement/ Decrement practice
14th Dec Project1 v0.4
prime numbers using functions
Spring 2017 Project 2 v1.1
B_141121_fibonacci
150109_RecursividadParImpar
GCC supports 128-bit integer arithmetic
bitwise operations
Please log in to post a comment.