FIND YOUR NEXT FEW LINES

Results for “k”

Small, practical examples. Search by task or narrow things down below.

1871 snippets foundClear filters
CArray transformations

Calculate a cumulative sum for each position

C: Keep a running total and store each prefix result in a separate output array.

C✓ Tested
Arduino / CGetting Started

Calculate a fixed array’s element count

Arduino / C: Calculate a fixed array’s element count on an Uno with the Serial Monitor set to 9600 baud.

Arduino / C✓ Tested
CSmall algorithms & bit operations

Calculate a fixed-window moving average

C: For this small window, sum each complete group and skip incomplete prefixes.

C✓ Tested
CSmall algorithms & bit operations

Calculate a least common multiple using a GCD

C: Divide before multiplying to reduce the risk of intermediate overflow.

C✓ Tested
GoJSON & encoding

Calculate a SHA-256 text digest

Calculate a SHA-256 text digest using a complete Go program with explicit sample inputs.

Go✓ Tested
GoGetting Started

Calculate a subtotal

Calculate a subtotal using a complete Go program with explicit sample inputs.

Go✓ Tested
AngularGetting Started

Calculate a value in a template

Calculate a value in a template with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
ReactGetting Started

Calculate a value inside JSX

Calculate a value inside JSX with a small React component and explicit browser behavior.

React✓ Tested
RustGetting Started

Calculate an order subtotal

Calculate an order subtotal in a complete Rust program using the standard library.

Rust✓ Tested
C++Sequence algorithms

Calculate changes between successive readings

C++: adjacent_difference keeps the first value and then writes each difference from its predecessor.

C++✓ Tested
ReactState & reducers

Calculate derived state during rendering

Calculate derived state during rendering with a small React component and explicit browser behavior.

React✓ Tested
Bash ScriptsGetting Started

Calculate with integer arithmetic

Bash Scripts: Calculate with integer arithmetic with a small standalone Bash program.

Bash Scripts✓ Tested