In the C language, a structure is used to express complex data types. The structure contains members that describe different parts of this complex data, such as a matrix required in this month’s Exercise.
Continue reading
Category Archives: Solution
The Seventh Line – Solution
This month’s programming Exercise isn’t as much about file access as it’s about dealing with a situation when no data is available. The task: Read the seventh line from a file.
Continue reading
Clear the Screen – Solution
The task for this month’s Exercise is to clear the screen. I pray you didn’t arrive at a solution that outputs multiple blank lines. No, you must use the ANSI codes offered in the exercise post to manipulate the cursor and wipe clean the screen. Or you could cheat, which is what I did.
Continue reading
Adding Two Values – Solutions
This month’s Exercise is rather simple, though it doesn’t promise a simple solution. Instead, I offer three solutions. One of which is obvious and two are kind of out there. They all work, which is the point.
Continue reading
Calculating the Standard Deviation – Solution
The challenge for this month’s Exercise is to calculate the standard deviation for a given set of data points. It’s a “whole population calculation” because all the data points are present. The trick is to follow the equation, transforming it from cryptic math mumbo-jumbo into C code.
Continue reading
Calculating the Absolute Value – Solution
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
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