Un exercice Zig calcule un bulletin de notes avec boucle for et moyenne en f32
An author shares a Zig programming exercise, built with Zig 0.17.0 and the ZLS extension in VS Code, that analyzes a fixed array of five grades. The program sums the grades with a for loop, identifies the highest one, and computes the average as an f32 using @floatFromInt conversions. It then prints a summary and reports whether the student is admitted (average of at least 10) or must retake. The author notes that the exercise taught them how to find a maximum in an array and plans to cover functions and error handling next.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in