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
Hello, World
A_141211_FuncionesVarias
Ordered Openmp
32bit
fork
Float data type.c
22nd HW Switchv0.24
Mem alloc test
tom grey wolf
T3.C