Help


Can anyone help me make this program?

It is necessary to make the following program: to enter two variables (example a = 323 and b = 4546), then to merge these variables into a new variable x (x = 3234546), and then that this variable can be decomposed into a = 323 and b = 4546
How much are you offering?
goodness. I don't think anyone has ever actually taken the sarcastic 'put it in the jobs section' literally before.

This is a freebie. If you want to learn to code, you need to start doing it and asking questions once you tried, but the first few programs an example can help get a feel for it and its only a couple lines.
1
2
3
4
5
6
7
8
9
10
#include<iostream>
#include<cmath>
int main()
{
int a = 4546;
int b10 = log10(a)+1;  //may want to make it +.999 or something.  watch for stuff like 1000 even etc, if you need to.
int b = 323;
uint64_t result = b*std::pow(10,b10) + a;
std::cout << result;
}


next time, please do TRY first; I won't do very many for you, and nothing more than a few lines.
Last edited on
Topic archived. No new replies allowed.