This month’s Exercise may not have been challenging. Still, remember that blog is about learning the C language. Sometimes performing what could be a simple task may end up being complex than you anticipated.
Continue reading
Category Archives: Solution
Calculating the Subfactorial – Solution
Do you feel adequately deranged working this month’s Exercise? I’m more of a math fanboy than an expert, yet I enjoyed the process of coding a subfactorial based in the equation presented.
Continue reading
Positive Negative Positive Negative – Solution
This month’s Exercise presents what I often refer to as a code “toggle.” Many paths lead to a solution.
Continue reading
The swap() Function – Solution
This month’s Exercise is to code a function that swaps two variables. The challenge really isn’t to swap the variables, but to figure out how to code a function that does so.
Continue reading
Tetration – Solution
Tetration is a bizarre mathematical concept. I’ve watched quite a few YouTube videos where math geeks explain the details. They venture into the terrifying territory of humongous numbers that would consume the known universe. Your programming challenge for this month’s Exercise is far less massive.
Continue reading
Numbers with Unique Digits – Solution
I hope you came up with an interesting solution for this month’s Exercise, one different from my own. The goal is to output unique values from zero through ten billion, values where no two digits repeat.
Continue reading
Coin Flipping Madness – Solution
I hope you didn’t “flip out” over this month’s Exercise. Flipping a coin can be done by hand or by using a computer. Using a computer is easier because it can be programmed to record each flip and it saves you hand muscle molecules for flipping and the chore of writing down the results.
Continue reading
Finding Characters – Solution
The challenge for this month’s Exercise is to write the charcount() function, which returns the number of characters in a string. The character matches exactly, so don’t worry about checking uppercase and lowercase differences.
Continue reading
From camelCase to snake_case – Solution
The challenge for this month’s Exercise is to convert a name from camelCase to snake_case and vice-versa. As usual, several approaches provide a possible solution. The directions were to output the results and not store them, so my solution is rather simple.
Continue reading
The Sum of the Integer’s Digit – Solution
The challenge for this month’s Exercise is to tally the digits in an integer, reporting the sum. You must use math and not cheat by looking at the old solution, which I didn’t. Promise.
Continue reading