Home Whiteboard Online Compilers Practice Articles Tools
Library Courses Certifications Login
Erlang Tutorial
  • Erlang - Home
  • Erlang - Overview
  • Erlang - Environment
  • Erlang - Basic Syntax
  • Erlang - Shell
  • Erlang - Data Types
  • Erlang - Variables
  • Erlang - Operators
  • Erlang - Loops
  • Erlang - Decision Making
  • Erlang - Functions
  • Erlang - Modules
  • Erlang - Recursion
  • Erlang - Numbers
  • Erlang - Strings
  • Erlang - Lists
  • Erlang - File I/O
  • Erlang - Atoms
  • Erlang - Maps
  • Erlang - Tuples
  • Erlang - Records
  • Erlang - Exceptions
  • Erlang - Macros
  • Erlang - Header Files
  • Erlang - Preprocessors
  • Erlang - Pattern Matching
  • Erlang - Guards
  • Erlang - BIFS
  • Erlang - Binaries
  • Erlang - Funs
  • Erlang - Processes
  • Erlang - Emails
  • Erlang - Databases
  • Erlang - Ports
  • Erlang - Distributed Programming
  • Erlang - OTP
  • Erlang - Concurrency
  • Erlang - Performance
  • Erlang - Drivers
  • Erlang - Web Programming
  • Erlang - Quick Guide
  • Erlang - Useful Resources
  • Erlang - Discussion
  • Selected Reading
  • UPSC IAS Exams Notes
  • Developer's Best Practices
  • Questions and Answers
  • Effective Resume Writing
  • AI Based Resume Builder
  • Personal AI Study Assistant
  • Generate Coding Logic
  • HR Interview Questions
  • Computer Glossary
  • Who is Who

Erlang - sum



Previous
Quiz
Next

Returns the sum of elements in the list.

Syntax

sum(lst)

Parameters

  • Lst − The list of elements.

Return Value

Returns the sum of elements in the list.

For example

-module(helloworld). 
-import(lists,[sum/1]). 
-export([start/0]). 

start() -> 
   Lst1 = [5,6,4], 
   io:fwrite("~p~n",[sum(Lst1)]).

Output

When we run the above program, we will get the following result.

15
erlang_lists.htm
Print Page
Previous
Next
Advertisements
TOP TUTORIALS
  • Python Tutorial
  • Java Tutorial
  • C++ Tutorial
  • C Programming Tutorial
  • C# Tutorial
  • PHP Tutorial
  • R Tutorial
  • HTML Tutorial
  • CSS Tutorial
  • JavaScript Tutorial
  • SQL Tutorial
TRENDING TECHNOLOGIES
  • Cloud Computing Tutorial
  • Amazon Web Services Tutorial
  • Microsoft Azure Tutorial
  • Git Tutorial
  • Ethical Hacking Tutorial
  • Docker Tutorial
  • Kubernetes Tutorial
  • DSA Tutorial
  • Spring Boot Tutorial
  • SDLC Tutorial
  • Unix Tutorial
CERTIFICATIONS
  • Business Analytics Certification
  • Java & Spring Boot Advanced Certification
  • Data Science Advanced Certification
  • Cloud Computing And DevOps
  • Advanced Certification In Business Analytics
  • Artificial Intelligence And Machine Learning
  • DevOps Certification
  • Game Development Certification
  • Front-End Developer Certification
  • AWS Certification Training
  • Python Programming Certification
COMPILERS & EDITORS
  • Online Java Compiler
  • Online Python Compiler
  • Online Go Compiler
  • Online C Compiler
  • Online C++ Compiler
  • Online C# Compiler
  • Online PHP Compiler
  • Online MATLAB Compiler
  • Online Bash Terminal
  • Online SQL Compiler
  • Online Html Editor
  • ABOUT US
  • OUR TEAM
  • CAREERS
  • JOBS
  • CONTACT US
  • TERMS OF USE
  • PRIVACY POLICY
  • REFUND POLICY
  • COOKIES POLICY
  • FAQ'S
tutorials point logo
Download Android App Download IOS App

Tutorials Point is a leading Ed Tech company striving to provide the best learning material on technical and non-technical subjects.

© Copyright 2025. All Rights Reserved.