If the integer value of each cell in the array contains more than one Sign :
int A[6] = {77,89,84,69,88,84};
#include <iostream>
int main()
{
int A[6] = {77,89,84,69,88,84};
int lengthA = 6;
int num = 0;
for(int x = 0; x < lengthA; x++)
{
num = num*10 + A[x];
}
std::cout<<"Result: "<<num;//Result: 8681864
return 0;
}
Execution result:
8681864
instead of:
778984698884
The same result will be the execution of all other examples from the answers provided here, because they work according to the same principle.
How to solve this problem?