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

Newer posts →

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

Just Average – Solution

Posted on January 8, 2015 by dgookin

If you attempted to compile the code skeleton for this month’s Exercise, you most likely stumbled across the first problem to solve: The average() function requires a type.
Continue reading →

Posted in Solution

Making Change – Solution

Posted on December 8, 2014 by dgookin

To solve this month’s Exercise you had to figure out a way to divvy up a dollar amount into the proper number of quarters, dimes, nickels, and pennies. As with many programming puzzles, a number of ways exist to code a solution. Click here to view mine.
Continue reading →

Posted in Solution

From Text to Integer – Solution

Posted on November 8, 2014 by dgookin

This month’s Exercise is to code a function that converts a string of text numbers into an integer value. If you used the skeleton provided, then your program’s output would look like this:

The string 24680 represents value 24680.

Continue reading →

Posted in Solution

The Inverse Pyramid – Solution

Posted on October 8, 2014 by dgookin

The task for this month’s Exercise was to create code that outputs an inverse number pyramid.

Here’s what such a thing looks like:

0000000000
999999999
88888888
7777777
666666
55555
4444
333
22
1

Continue reading →

Posted in Solution

Post navigation

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