Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
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
1
#Define / Case/ If practice
String operations in C (without using built-in methods)
numerodevecesquerepitedigitoennumero
lab9tho
acepta el reto 146
Area and Volume coding
cstructHotel
ptr_to_ptr
json string formatter
DIGITOS DE U. A DECENAS