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 →

Merging Arrays – Solution

Posted on March 8, 2023 by dgookin
Reply

This month’s Exercise is about coding a merge() function, which swallows two arrays and generates a third as output. The new array is “zippered” from the original arrays, alternating values from each.
Continue reading →

Posted in Solution | Leave a reply

A Compact for Loop – Solution

Posted on February 8, 2023 by dgookin
3

I hope you were able to cram a lot of expressions into a for loop statement, which is the challenge for this month’s Exercise. Even if you know this trick, it’s important to understand it’s limitations — which is something I discovered during my research.
Continue reading →

Posted in Solution | 3 Replies

How Big is That File? – Solution

Posted on January 8, 2023 by dgookin
6

The challenge for this month’s Exercise is to return a file’s size without using the stat() function. My goal is to get you to think about various file tools and how they can be useful beyond their intended purpose.
Continue reading →

Posted in Solution | 6 Replies

Quick Sorting Structures – Solution

Posted on December 8, 2022 by dgookin
Reply

The task for this month’s Exercise is to extract a structure member from a void pointer for use in the quick-sort compare() function. This isn’t a solution you can readily find on the Interwebs.
Continue reading →

Posted in Solution | Leave a reply

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

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