C Online Compiler
Example: A Very Big Sum in C Program
C
C++
C#
Java
Python
PHP
main.c
STDIN
Run
// A Very Big Sum in C Program #include <stdio.h> int main() { int s = 0; printf("Enter the size of array::\n"); scanf("%d", &s); long arr[s], sum=0; int i=0; while (i<s) { scanf("%ld", &arr[i]); sum += arr[i]; i++; } // It will return the final output printf("\nBig Sum = %ld\n", sum); return 0; }
5 1000000001 1000000002 1000000003 1000000004 1000000005
Output
Clear
ADVERTISEMENTS