C++ Online Compiler
Example: A Very Big Sum C++ Program using For loop
C
C++
C#
Java
Python
PHP
main.cpp
STDIN
Run
// A Very Big Sum C++ Program using For loop #include <iostream> using namespace std; int main() { int s = 0; cout << "Enter the size of array::\n"; cin >> s; long arr[s], sum=0; for (int i=0; i<s; i++) { cin >> arr[i]; sum += arr[i]; } // It will return the final output cout << "\nBig Sum = " << sum << endl; return 0; }
6 1000010000010001 1000010000010002 1000010000010003 1000010000010004 1000010000010005 1000010000010006
Output
Clear
ADVERTISEMENTS