Results for “k”
Small, practical examples. Search by task or narrow things down below.
Calculate a cumulative sum for each position
C: Keep a running total and store each prefix result in a separate output array.
C✓ Tested
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
Calculate a fixed-window moving average
C: For this small window, sum each complete group and skip incomplete prefixes.
C✓ Tested
Calculate a least common multiple using a GCD
C: Divide before multiplying to reduce the risk of intermediate overflow.
C✓ Tested
Calculate a SHA-256 text digest
Calculate a SHA-256 text digest using a complete Go program with explicit sample inputs.
Go✓ Tested
Calculate a subtotal
Calculate a subtotal using a complete Go program with explicit sample inputs.
Go✓ Tested
Calculate a value in a template
Calculate a value in a template with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Calculate a value inside JSX
Calculate a value inside JSX with a small React component and explicit browser behavior.
React✓ Tested
Calculate an order subtotal
Calculate an order subtotal in a complete Rust program using the standard library.
Rust✓ Tested
Calculate changes between successive readings
C++: adjacent_difference keeps the first value and then writes each difference from its predecessor.
C++✓ Tested
Calculate derived state during rendering
Calculate derived state during rendering with a small React component and explicit browser behavior.
React✓ Tested
Calculate with integer arithmetic
Bash Scripts: Calculate with integer arithmetic with a small standalone Bash program.
Bash Scripts✓ Tested