BackeasyIntroduction to Arrays Cognizant Swiggy

Calculate Total Temperature Solution

Problem Statement

You are given an array of integers representing temperature readings at various depths. Implement a function to traverse the array and calculate the total temperature reading.

Example 1
Input
[1, 2, 3, 4, 5]
Output
15

Explanation: The function should sum all the elements in the array

Constraints

  • {"description":"1 <= Array size <= 1000","type":"integer"}
  • {"description":"-1000 <= Array elements <= 1000","type":"integer"}
Live Compiler
Loading...
Test Cases & Output
🔒 Sign up to run your code

🚀 Practice this problem

Run code, get AI hints & track streak

Sign Up Free