One thing you can do that I find comes up pretty often in C is start using switch statements to avoid code duplication. Because your operators all take 2 numbers, you’ve separated out the input handling into its own block; that alone is a really good insight.
You can take it another step further by making your print statement also, mostly, one block of code, with the only difference being the operation being preformed. By printing “The” followed by using an if-else block — or, again, preferably a switch statement — to both print the operation text, and compute memory, you can print the remainder of the line the same way for every operation.
It may seem nitpicky for such a simple program; but the use case of C is for programs which require tight execution and often contain complex, low-level logic. Reducing complexity whenever possible helps make C more readable, as well as signal when the complexity is necessary.
The same person as Daedskin@lemm.ee and Daedskin@programming.dev
- 0 Posts
- 4 Comments
Joined 7 months ago
Cake day: June 26th, 2025
You are not logged in. If you use a Fediverse account that is able to follow users, you can follow this user.
No; I use it decently often. I also know that typing “2014” and pressing alt-x in Word will insert an emdash if I don’t have access to a number pad.



With reflowing zoom, all elements get bigger, but lose their relative sizing; eg. sidebars will remain on the screen, taking up relatively more space than they usually would. With pinch zoom, all elements get bigger, and retain their relative sizing to each other.
Basically, reflowing zoom tries to fit everything into a smaller space, while pinch zoom expands everything equally.