Timer is Running

Here, we'll learn the delete keyword that's used to clear the dynamically allocated memory in CPP.

Given a dynamic array A of size N. The task is to find the sum of array elements.

Input Format:
First line of input contains number of testcases T. For each testcase, there will two line of input, first of which contains N, size of array. Next line contains N integers.

Outpu Formatt
For each testcase, output the sum of array elements and in next line prints the first array element(A[0]).

Your Task:
Just comment the line that is deallocating the array.

1 <= T <= 10
1 <= N <= 100
1 <= A[i] <= 105


1 2 3 4 5


Testcase 1:
Sum of array elements is 15 (1 + 2 + 3 + 4 + 5). The first element is 1.

** For More Input/Output Examples Use 'Expected Output' option **

Author: Dhiman Mayank

If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.

Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.