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 →

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

Let’s Go Bowling – Solution

Posted on May 8, 2015 by dgookin
Reply

You may find my solution for this month’s Exercise to be more complex than necessary, but there’s a method to my madness.
Continue reading →

Posted in Solution | Leave a reply

Board of Chess – Solution

Posted on April 8, 2015 by dgookin
Reply

A chessboard is merely a two-dimensional array — a matrix — one where the rows and columns are the same size. As long as you can write code to output an 8-by-8 board, you can modify the code to reset the board’s size to any value.
Continue reading →

Posted in Solution | Leave a reply

Pattern Manipulation – Solution

Posted on March 8, 2015 by dgookin
3

This month’s Exercise was to create a cycle of numbers, values that repeat within a certain range. Of all the Exercises presented so far on this site, this one probably has the greatest number of solutions.
Continue reading →

Posted in Solution | 3 Replies

Round Numbers – Solution

Posted on February 8, 2015 by dgookin

This month’s Exercise required you to create three rounding functions: roundup(), rounddown(), and roundhalf(). Each one deals with a floating-point value in a specific way, but they all handle the basic rounding chore by typecasting a floating point variable to an integer.
Continue reading →

Posted in Solution

Post navigation

← Older posts
Newer posts →

Recent Posts

  • Tagging a Union
  • The Clock Angle Problem – Solution
  • The Scary Part of the Union
  • The Clock Angle Problem
  • Back When Unions Were Useful

Recent Comments

  • dgookin on The Clock Angle Problem – Solution
  • Chris Webb on The Clock Angle Problem – Solution
  • Chris Webb on The Clock Angle Problem – Solution
  • dgookin on The Clock Angle Problem
  • Chris Webb on The Clock Angle Problem

Meta

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

Copyright © 1997-2026 by QPBC.
All rights reserved

Proudly powered by WordPress