Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
CS HW2
/*Simple program showing how to read an integer and printing it to output in different formats.*/ #include "stdio.h" void aProgram(int a, int b) { int count = 1; int num = 0; while (a > 0 || b > 0) { num = num * 10; if (a > 0 && count % 2 != 0) { int temp = a; int counter = 1; while (temp / 10 != 0) { temp = temp / 10; counter = counter * 10; } num = num + temp; a = a - temp * counter; } else if (b > 0 && count % 2 == 0) { int temp = b; int counter = 1; while (temp / 10 != 0) { temp = temp / 10; counter = counter * 10; } num = num + temp; b = b - temp * counter; } } printf(%d, num); } int main(void) { aProgram(90128, 7823); return 0; }
run
|
edit
|
history
|
help
0
array poi
Bitfield and Union in C - strange results
150109_RecursividadPrimo
B_141202_CADENA_NUMERO
C_141106_Factorial
1.2 No. of Threads
test
a1
Official Hello world
dcl