નેટ WPM0
WPM0
ચોક્કસતા100%
વિતી ગયેલ0s
સમય—
અક્ષરો0
ખોટો0
ભૂલો0
પ્રગતિ0%

Shift + Enter · Start / restart

કોડ પ્રોમ્પ્ટ માર્ગદર્શિકા વાંચો
પ્રોગ્રામિંગ ભાષા
C++
મુશ્કેલી
મધ્યમ

Use a range-based loop to total vector values.

#include <iostream>
#include <vector>

int main() {
    std::vector<int> values{4, 8, 15, 16, 23, 42};
    int total = 0;

    for (int value : values) {
        total += value;
    }

    std::cout << total << '\n';
}