Exercise on For Loops

We'll cover the following


We have learnt that for loops are used as while loops in Go. Given below is a C++ code that uses a while loop to sum an array of numbers. Rewrite the code in Go so that it uses a for loop to sum a given list of numbers:

Get hands-on with 1200+ tech skills courses.