Skip to primary content
Skip to secondary content

C For Dummies Blog

Main menu

  • C For Dummies (home)
  • History
  • Series
  • Supplemental
  • Blog Miscellany

Category Archives: Solution

Post navigation

← Older posts
Newer posts →

Testing Your Pointer Prowess – Solution

Posted on February 8, 2025 by dgookin
Reply

The solution for this month’s Exercise is to output the string "I am an excellent C programmer". This task isn’t so simple when you must untie the knot of the dratted double pointer.
Continue reading →

Posted in Solution | Leave a reply

Emulating the Modulus Operator – Solution

Posted on January 8, 2025 by dgookin
Reply

In an alternative universe, the C programming language lacks a modulus operator and no companion function exists in the library. What to do! Why, you code your own modulus function, which is the challenge for this month’s Exercise.
Continue reading →

Posted in Solution | Leave a reply

The Double Factorial – Solution

Posted on December 8, 2024 by dgookin
Reply

This month’s Exercise is to write code to calculate a double factorial, which uses the !! notation. A double factorial works like a factorial, but uses only odd or even values based on the parity of the starting value.
Continue reading →

Posted in Solution | Leave a reply

Ethiopian Multiplication – Solution

Posted on November 8, 2024 by dgookin
3

The challenge for this month’s Exercise is to write code that uses the Ethiopian Multiplication method. The process involves doubling and halving the factors, then eliminating and finally tallying the result.
Continue reading →

Posted in Solution | 3 Replies

Multiplying Matrixes – Solution

Posted on October 8, 2024 by dgookin
Reply

My solution for this month’s Exercise relies upon the solution from last month’s Exercise, specifically the way the matrixes are presented in the main() function and the use of the output() function. What I added is the multiply() function, which multiplies the two matrixes.
Continue reading →

Posted in Solution | Leave a reply

Describing Complex Data – Solution

Posted on September 8, 2024 by dgookin
2

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 →

Posted in Solution | 2 Replies

The Seventh Line – Solution

Posted on August 8, 2024 by dgookin
Reply

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 →

Posted in Solution | Leave a reply

Clear the Screen – Solution

Posted on July 8, 2024 by dgookin
4

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 →

Posted in Solution | 4 Replies

Adding Two Values – Solutions

Posted on June 8, 2024 by dgookin
Reply

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 →

Posted in Solution | Leave a reply

Calculating the Standard Deviation – Solution

Posted on May 8, 2024 by dgookin
6

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 →

Posted in Solution | 6 Replies

Post navigation

← Older posts
Newer posts →

Recent Posts

  • Cooked or Raw?
  • Is It a “Real” Triangle? – Solution
  • Getting and Setting the File Position Indicator
  • Is It a “Real” Triangle?
  • A Colorful Hexdump

Recent Comments

  • dgookin on Is It a “Real” Triangle? – Solution
  • Chris Webb on Is It a “Real” Triangle? – Solution
  • dgookin on A Colorful Hexdump
  • Chris Webb on A Colorful Hexdump
  • dgookin on Code Page 437

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Copyright © 1997-2026 by QPBC.
All rights reserved

Proudly powered by WordPress