Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

A Very Big Sum #30

Open
ndrohith09 opened this issue Oct 18, 2022 · 5 comments
Open

A Very Big Sum #30

ndrohith09 opened this issue Oct 18, 2022 · 5 comments
Assignees
Labels
easy question Further information is requested

Comments

@ndrohith09
Copy link
Member

In this challenge, you are required to calculate and print the sum of the elements in an array, keeping in mind that some of those integers may be quite large.

Function Description

Complete the aVeryBigSum function in the editor below. It must return the sum of all array elements.
aVeryBigSum has the following parameter(s):

  • int ar[n]: an array of integers .

Return

  • long: the sum of all array elements

Input Format

The first line of the input consists of an integer .
The next line contains space-separated integers contained in the array.

Output Format

Return the integer sum of the elements in the array.

Constraints

1 <= n <= 10
0 <= ar[i] <= 10^10 

Sample Input

5
1000000001 1000000002 1000000003 1000000004 1000000005

Output

5000000015

Note:

The range of the 32-bit integer is (-2^31) to (2^31 -1) or [-2147483648 , 21474836647] .
When we add several integer values, the resulting sum might exceed the above range. You might need to use long int C/C++/Java to store such sums.

When we add several integer values, the resulting sum might exceed the above range. You might need to use long int C/C++/Java to store such sums.

@ndrohith09 ndrohith09 added the question Further information is requested label Oct 18, 2022
@Tr1ck-5t3r
Copy link
Contributor

i would like to provide the solution in java

@Ranganathkotta
Copy link
Contributor

hiii i have solved using c can u assign this one

@theNamanchauhan
Copy link
Contributor

I want to solve it using python

theNamanchauhan added a commit to theNamanchauhan/hacktoberfest that referenced this issue Oct 19, 2022
@theNamanchauhan
Copy link
Contributor

@ndrohith09 Hello I have solved this issue using python can you please assign me this one

@Gamer5262 Gamer5262 mentioned this issue Oct 26, 2022
Closed
Gamer5262 added a commit to Gamer5262/hacktoberfest that referenced this issue Oct 26, 2022
ndrohith09 added a commit that referenced this issue Oct 27, 2022
@art-rauniyar
Copy link
Contributor

I would like to solve this problem in c#.

art-rauniyar added a commit to art-rauniyar/hacktoberfest that referenced this issue Oct 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
easy question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants