Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
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.
date diff sample
Run code before/after main in C (GCC)
Mutex Safe
Lab 7 blackjack v0.9
DUE TUESDAY
gkckibvsj
lab6
Max2
Add.c
funcion quicksort
Please log in to post a comment.