79605598

Date: 2025-05-04 12:13:50
Score: 1.5
Natty:
Report link

If integer value of each cell in the array contains more than one character

int A[5] = {77,89,84,69,88,84};

then

#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;
}

The result of the execution will be 8681864, in place of the expected 778984698884.

                           How to resolve this situation?

P.S. All other code execution examples from the answers will be the same result, because they work on the same principle.

Reasons:
  • RegEx Blacklisted phrase (1.5): How to resolve this situation?
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: GeorgeCain