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 →

Appreciation for Depreciation – Solution

Posted on March 8, 2016 by dgookin
Reply

This month’s Exercise is one of those old, programming warhorses: Calculate a depreciation schedule. At the simplest level, the solution is a mathematical loop and keeps subtracting a given percentage from a value.
Continue reading →

Posted in Solution | Leave a reply

Text Parsing Power – Solution

Posted on February 8, 2016 by dgookin
Reply

This month’s Exercise hosts a realm of possible solutions. So I present you with my three solutions, two of which are general and one specific.
Continue reading →

Posted in Solution | Leave a reply

Defensive Input – Solution

Posted on January 8, 2016 by dgookin
Reply

Writing an input routine isn’t that difficult in C. I cobble together simple input routines all the time. The scanf() function is brilliant for such situations. When you have to test input, things get dicey, which I hope you discovered as you attempted this month’s exercise.
Continue reading →

Posted in Solution | Leave a reply

Merry Cumulative Song Exercise – Solution

Posted on December 8, 2015 by dgookin
Reply

I crafted my solution to the cumulative song exercise by separating the parts of the song that are repeated from the unique text. Specifically, the ordinal days are unique as well as the gifts. The rest of the text is sung over and over.
Continue reading →

Posted in Solution | Leave a reply

Hex Parsing – Solution

Posted on November 8, 2015 by dgookin
Reply

Two solutions are possible for this month’s Exercise, a string solution and a value solution. One is good for parsing the hex string right-to-left, the other for parsing the string left-to-right.
Continue reading →

Posted in Solution | Leave a reply

The Hailstone Sequence – Solution

Posted on October 8, 2015 by dgookin
Reply

My solution to this month’s Exercise is split into two main parts. The first part generates the random value in the range of 1 to 100. The second part performs the Hailstone sequence on that value.
Continue reading →

Posted in Solution | Leave a reply

Flip That Bit – Solution

Posted on September 8, 2015 by dgookin
Reply

For my solution to this month’s Exercise I went binary. Several of the C language operators work at a binary level. Because the exercise was to make a binary, or bitwise, modification, I figured a binary operator would be in order.
Continue reading →

Posted in Solution | Leave a reply

Plotting Squares – Solution

Posted on August 8, 2015 by dgookin
Reply

The key to unlocking this month’s Exercise is not to go insane on the code that processes the solution. As I wrote in the Exercise post, with data analysis in C, it’s important to properly represent the data so that you can easily manipulate it.
Continue reading →

Posted in Solution | Leave a reply

Spelling Alphabet – Solution

Posted on July 8, 2015 by dgookin
Reply

This month’s task was to create code that translates spelling from a single word into the corresponding NATO phonetic alphabet words. For input such as hello the output would be something like:

Hotel Echo Lima Lima Oscar
Continue reading →

Posted in Solution | Leave a reply

Let’s Go Bowling – An Entire Game – Solution

Posted on June 8, 2015 by dgookin
Reply

To make the conversion between simulating a single frame of bowling and an entire game isn’t that simple, which is mostly due to calculating the dreaded 10th Frame.
Continue reading →

Posted in Solution | Leave a reply

Post navigation

← Older posts
Newer posts →

Recent Posts

  • C Blog 13th Anniversary
  • Colorful Data Chunks
  • A Little Bit Off the Sides – Solution
  • Working with Data Chunks
  • A Little Bit Off the Sides

Recent Comments

  • dgookin on C Blog 13th Anniversary
  • M.Stumpfl on C Blog 13th Anniversary
  • Chris Webb on C Blog 13th Anniversary
  • M.Stumpfl on A Little Bit Off the Sides – Solution
  • dgookin on A Little Bit Off the Sides – Solution

Meta

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

Copyright © 1997-2026 by QPBC.
All rights reserved

Proudly powered by WordPress