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 →

Spelling Numbers – Solution

Posted on September 8, 2020 by dgookin
Reply

The task for this month’s Exercise is to write code that outputs strings for number values, 0 through 100. Your goal is to be clever with your solution, something that took me a few versions to get correct.
Continue reading →

Posted in Solution | Leave a reply

Multiples of Four – Solution

Posted on August 8, 2020 by dgookin
Reply

The solution this month’s Exercise isn’t that complex, but it was handy in disproving a theory.
Continue reading →

Posted in Solution | Leave a reply

Nested Processing – Solution

Posted on July 8, 2020 by dgookin
5

This month’s Exercise wasn’t astronomically difficult, but I did spend some time devising a solution. My goal was to try to avoid writing a nested loop. This goal proved unattainable.
Continue reading →

Posted in Solution | 5 Replies

Getting to Euler’s Number – Solution

Posted on June 8, 2020 by dgookin
Reply

The challenge for this month’s Exercise is not only to calculate Euler’s number, e, but to count how many loops a program must endure before your e value calculation matches the defined constant M_E. I hope you didn’t find this challenge too difficult.
Continue reading →

Posted in Solution | Leave a reply

Tic-Tac-Toe Evaluation – Solution

Posted on May 8, 2020 by dgookin
Reply

The insidious part of this month’s Exercise is writing a function that doesn’t count a stalemate as a win. It’s what happened to me for my first draft of a solution.
Continue reading →

Posted in Solution | Leave a reply

No Nines – Solution

Posted on April 8, 2020 by dgookin
Reply

The challenge for this month’s Exercise is to determine whether an integer, 1 to 100, is divisible by nine or contains the digit ‘9’. It seems like an easy puzzle for a C programmer to solve, but what I found interesting was crafting the output — specifically when a number both contains ‘9’ and is divisible by nine.
Continue reading →

Posted in Solution | Leave a reply

Dump That File! – Solution

Posted on March 8, 2020 by dgookin
Reply

I’ve been coding hexdump utilities since the microcomputer era. They’re just so handy, especially when writing structures or other formatted data to a file. The dump assists with debugging, and it helps you figure out some undocumented data structures as well.
Continue reading →

Posted in Solution | Leave a reply

Automated Guessing Game – Solution

Posted on February 8, 2020 by dgookin
Reply

In the climatic scene of the movie Wargames, the WOPR computer plays Tic-Tac-Toe. A question is asked, “Can the computer play itself?” This postulation forms the basis of all computer learning, but that wasn’t the puzzle for this month’s Exercise.
Continue reading →

Posted in Solution | Leave a reply

Remove Trailing Blank Lines – Solution

Posted on January 8, 2020 by dgookin
Reply

The problem with snipping blank lines from the end of a file is storing the file as it’s processed. At least that’s the issue I faced as I worked through my solution to this month’s Exercise.
Continue reading →

Posted in Solution | Leave a reply

Morse Code Filter – Solution

Posted on December 8, 2019 by dgookin
3

A Morse Code filter probably has no practical use, but it’s a good programming exercise. The issue is how to deal with undefined character codes and otherwise present the output. My solution for this month’s Exercise involves interpreting standard input, discarding undefined information, and sending the results to standard output in a format that isn’t ugly.
Continue reading →

Posted in Solution | 3 Replies

Post navigation

← Older posts
Newer posts →

Recent Posts

  • The Ever-Expanding Pointer Array
  • Heron’s Formula – Solution
  • Coding a Better stringcopy() Function
  • Heron’s Formula
  • Copying Strings

Recent Comments

  • dgookin on Heron’s Formula
  • Chris Webb on Heron’s Formula
  • dgookin on Heron’s Formula
  • Chris Webb on Heron’s Formula
  • dgookin on Finding Those Pesky Null Characters!

Meta

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

Copyright © 1997-2025 by QPBC.
All rights reserved

Proudly powered by WordPress