Menu
Coddy logo textTech

Sum of numbers

Lesson 10 of 32 in Coddy's Coding Problems course.

Create a program that will calculate the sum of N entered numbers from input.

challenge icon

Challenge

Easy

Write a program that gets a natural number N. In the next N lines there is only one number in each line. Output the total sum of all of the entered numbers.

 

Input
3
10
20
30

Output
60

Input
2
100
50

Output
150

Try it yourself

#include <stdio.h>

int main() {
    // Write code here
    return 0;
}

All lessons in Coding Problems