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
Good
array poi
Sorting Character array using Qsort
C_141113_euclides
G
co_4
to upper case string
Intro to Arrays with comments
C pattern Rhombus
223780