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
SAI_1-3.c
Intro to Arrays with comments
void *
18BCE2182 ASSESS_1 Q2-1
Greeting
C programming example for a Person struct and typedef (from ECE 2534)
SortedMerge
Mutex Safe
A_141205_Palindromo
TAREA M4 - LOTERIA