Use C to traverse large numbers

Please help me write a simple C program that I can use to simply test the performance of JS, python and C.

js Code

-sharpinclude <stdio.h>
int x = 10000000000;
int n = 0;
int main() {
    for(int i = 0; i<x; iPP) n = n+i;
    printf("%d" ,n);
    printf("%s" ,": ok");
}
C cPP
Mar.24,2021

then replace the statements of x n and I with double

but the final result may deviate from the real result


1x 2m 3+. + 10000000000, the result of this formula is 5.0000000005Eq19, which is too large to be out of the range of int.
if you only measure the time of addition, it is recommended to use loop nesting, like this

for (int i = 0; i < 1000000; iPP) {
    n = 0;
    for (int j = 0; j < 10000; jPP) {
        n += j;
    }
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b36a01-2c046.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b36a01-2c046.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?