Skip to content

Sum from input

Go fmt.Scan / Println

Same task in: C++Rust

Flowchart (ISO 5807)

StartInput a, bOutput a + bEndFigure 1 — addTwo

Source code

Go
func addTwo() {
    var a, b int
    fmt.Scan(&a, &b)
    fmt.Println(a + b)
}

The editor opens with this code — change it and the chart redraws.

Language
Go
Constructs
fmt.Scan / Println
Topic
Input/Output
Formats
Word, Visio, draw.io, PDF, SVG

Related examples