I can not use sprintf, or any other function that puts everything together in a string n, I can not really use any libc function, it's part of a challenge I'm trying to solve
Given:
int x=5;
int y=2;
Expected Output:
res = 52;
I can not use sprintf, or any other function that puts everything together in a string n, I can not really use any libc function, it's part of a challenge I'm trying to solve
Given:
int x=5;
int y=2;
Expected Output:
res = 52;
This is one posible solution:
#include <stdio.h>
int main()
{
int x= 342;
int y= 224;
int aux = y;
while( aux ) {
aux /= 10;
x*= 10;
}
x+= y;
printf("x= %d\r\n", x); // prints 342224
}