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 →

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

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

  • What is the Largest Value?
  • Accessing the Mouse in a Terminal Window
  • Storing and Interpreting Mouse Input
  • Where is the Mouse?
  • Pulling Numbers from a String – Solution

Recent Comments

  • dgookin on Reading Raw Input
  • Chris Webb on Reading Raw Input
  • dgookin on Is It a “Real” Triangle? – Solution
  • Chris Webb on Is It a “Real” Triangle? – Solution
  • dgookin on A Colorful Hexdump

Meta

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

Copyright © 1997-2026 by QPBC.
All rights reserved

Proudly powered by WordPress