Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
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
Please
log in
to post a comment.
selection sort
FILE_operations
120465-11.1-3E
variable number of arguments
B_141202_CADENA_NUMERO
Lab6 v1.3Sin,cos,tan,cot
data types and printf
Project v0.12
709 lab 3.1
18BCE2182 ASSESS_1 Q1-1
Please log in to post a comment.