Deviopath › Go

Rectangle Area

Easy · Structs

A struct groups fields: type Rect struct { W int; H int }. A function can take a struct by value. Area is width times height.

Rect is already defined. Write Area(r) that returns r.W * r.H.

Next: Variadic Sum