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 →

Swapping Variables – Solution

Posted on June 8, 2023 by dgookin
2

This month’s Exercise challenges you to swap two variables’ values without using a third variable. It’s a solution widely available on the Internet, but your job is to figure out the technique without looking elsewhere.
Continue reading →

Posted in Solution | 2 Replies

Yesterday – Solution

Posted on May 8, 2023 by dgookin
Reply

The challenge for this month’s Exercise is to output yesterday’s date: the day of the week, day of the month, month, and year. It’s not as complex as it could be, though keep in mind that any code that outputs the proper result is valid.
Continue reading →

Posted in Solution | Leave a reply

Counting the Non-ASCII Bytes – Solution

Posted on April 8, 2023 by dgookin
2

Several items are noteworthy for this month’s Exercise , with the biggie being how to detect a non-ASCII character. The secret involves a wee bit of type conversion.
Continue reading →

Posted in Solution | 2 Replies

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

Post navigation

← Older posts
Newer posts →

Recent Posts

  • Cooked or Raw?
  • Is It a “Real” Triangle? – Solution
  • Getting and Setting the File Position Indicator
  • Is It a “Real” Triangle?
  • A Colorful Hexdump

Recent Comments

  • dgookin on Is It a “Real” Triangle? – Solution
  • Chris Webb on Is It a “Real” Triangle? – Solution
  • dgookin on A Colorful Hexdump
  • Chris Webb on A Colorful Hexdump
  • dgookin on Code Page 437

Meta

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

Copyright © 1997-2026 by QPBC.
All rights reserved

Proudly powered by WordPress