1

Code

long double sumArray = 0;
for (int i = 0; i < input; i++)
{
    sumArray = sumArray + array[i];
}

cout << sumArray;

Output should look like this

5
1000000001 1000000002 1000000003 1000000004 1000000005
5000000015

Instead, it showing this

5
1000000001 1000000002 1000000003 1000000004 1000000005
5e+09

I want to get the sum of all long double variable like this.

 5000000015
rpb
  • 2,628
  • 1
  • 17
  • 35
MONTASIM
  • 316
  • 2
  • 8

0 Answers0