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 →

Output a Colorful Chessboard – Solution

Posted on November 8, 2022 by dgookin
4

This month’s Exercise may not seem that difficult, especially given the variety of grid challenges and dimensional array lessons I’ve posted on this blog. Obviously, you need a nested loop. The tough part, however, is generating the grid of alternating colors.
Continue reading →

Posted in Solution | 4 Replies

Palindromic Numbers – Solution

Posted on October 8, 2022 by dgookin
3

The challenge for this month’s Exercise is to output the first 100 palindromic numbers, which are integers that reflect the same digits on either side. Rather than devise a complex mathematical equation to determine these values, I cheated.
Continue reading →

Posted in Solution | 3 Replies

Cyclops Numbers – Solution

Posted on September 8, 2022 by dgookin
3

I hope this month’s Exercise didn’t terrify you. I remember seeing The Seventh Voyage of Sinbad when I was a kid. The cyclops bothered me so much I asked my mom questions about him for a month.
Continue reading →

Posted in Solution | 3 Replies

From ‘A’ and ‘a’ to ‘Z’ and ‘z’ – Solution

Posted on August 8, 2022 by dgookin
Reply

I don’t believe one definitive solution exists for this month’s Exercise: Output a string of upper- and lowercase letters. No, the challenge is more to discover different insights a coder has to a specific problem.
Continue reading →

Posted in Solution | Leave a reply

Your Own Version of left-pad() – Solution

Posted on July 8, 2022 by dgookin
Reply

Can you write your own left-pad function in C? Would you get so angry that you’d pull it from the Jenga-tower NPM and bring the Internet to its knees? I hope your answer Yes to the first question and No to the second, because your task for this month’s Exercise is to write that function.
Continue reading →

Posted in Solution | Leave a reply

The Elevator Ride – Solution

Posted on June 8, 2022 by dgookin
Reply

To code a simulated elevator ride you must know the floor requests, up and down. This is the challenge given for this month’s Exercise, which can either drive you nuts or delight you depending on how you craft your solution.
Continue reading →

Posted in Solution | Leave a reply

Splitting a Decimal Value – Solution

Posted on May 8, 2022 by dgookin
2

Cleaving a decimal value into its integer and fractional portions is a neat trick, one that relies upon C natural capability to thwack off the decimal portion of a float when it’s recast as an integer. Knowing about this conversion makes solving this month’s Exercise a whole lot easier.
Continue reading →

Posted in Solution | 2 Replies

The Babylonian Square Root – Solution

Posted on April 8, 2022 by dgookin
2

Hammurabi
I was blown away by the elegance and simplicity of the Babylonian Method to calculate a square root, which is the topic of this month’s Exercise. I only hope that my solution lives up the challenge, lest I suffer the fate of the Assyrians.
Continue reading →

Posted in Solution | 2 Replies

Simplifying Fractions – Solution

Posted on March 8, 2022 by dgookin
3

This month’s Exercise both terrified and enticed me. Yes, I code these solutions myself after I think up the challenges. No cheating here! This particular puzzle was more fun than I imagined, but also required a lot of mental work.
Continue reading →

Posted in Solution | 3 Replies

The Microwave Problem – Solution

Posted on February 8, 2022 by dgookin
Reply


The challenge for this month’s Exercise is to write a microwave oven input routine: The user types in a given number of seconds and your program translates the value into the proper number of hours, minutes, and seconds. This type of problem may sound familiar.
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