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: Lesson

Post navigation

← Older posts
Newer posts →

Harmonic Series, Divergence, and C Code

Posted on December 19, 2020 by dgookin
2

A harmonic series is a mathematical contraption that deals with cascading fractions. Like the Fibonacci series, I thought I could easily code a harmonic series in C — which I did, but not before reading up on the topic of divergence.
Continue reading →

Posted in Lesson | 2 Replies

Fun With Series: Fibonacci and Harmonic

Posted on December 12, 2020 by dgookin
Reply

My maths grades were horrible. I understand the concepts, but failed at solutions in class because I’d make silly mistakes. Computers make mistakes only when they’re programmed to do so, which means maths are far more enjoyable for me as a coder. For example, take the Fibonacci sequence.
Continue reading →

Posted in Lesson | Leave a reply

My Chicken McNuggets Solution

Posted on December 5, 2020 by dgookin
Reply

Box of 20 Chicken McNuggets, McDonalds
The Chicken McNuggets problem, presented in last week’s Lesson, shows code that outputs the highest McNuggets number from 1 to 100. This value isn’t a combination of 6, 9, or 20, the number of the pieces offered in the McDonald’s Chicken McNuggets packages.
Continue reading →

Posted in Lesson | Leave a reply

The Chicken McNuggets Problem

Posted on November 28, 2020 by dgookin
2

Box of 20 Chicken McNuggets, McDonalds
Chicken McNuggets come several to a box, depending on what you order: six pieces for a kid, nine pieces for an adult, or twenty pieces for an honest adult. These numbers in various combinations form what the math nerds call McNugget Numbers.
Continue reading →

Posted in Lesson | 2 Replies

The Golden Ratio – Recursion Version

Posted on November 21, 2020 by dgookin
Reply

Oh, how I distrusted recursion when I was a budding programmer. It’s just a tough concept to wrap your head around, especially if you’re an old warhorse Assembly programmer like me who lives in fear of blowing up the stack. Trivial asides aside, recursion often presents an elegant and efficient way to solve a programming puzzle.
Continue reading →

Posted in Lesson | Leave a reply

The Golden Ratio

Posted on November 14, 2020 by dgookin
Reply

Like many other mathematical delights, the golden ratio pops up all over. It has a rich history, and a special Greek letter to represent it: φ phi. The value is irrational, meaning it cannot be expressed as a ratio of two integers: 1.6180339…
Continue reading →

Posted in Lesson | Leave a reply

More Efficient Prime Number Calculations

Posted on November 7, 2020 by dgookin
Reply

A long time ago, I looked at one of my prime number hunting programs, such as the one demonstrated in last week’s Lesson. I thought, “How can I make this program more efficient?” It’s something all programmers should do.
Continue reading →

Posted in Lesson | Leave a reply

Generating Prime Numbers

Posted on October 31, 2020 by dgookin
2

Numbers with only two factors, one and themselves, are prime. One way to discover which numbers are prime in a computer program is to plow through all the factors.
Continue reading →

Posted in Lesson | 2 Replies

A Matter of Factors

Posted on October 24, 2020 by dgookin
Reply

Prime numbers are a popular topic in computer programming. It surprised me that I hadn’t yet plumbed primes on this blog, so I’m past due. And forget about the nerdy aspect of prime numbers. Of all the concepts in mathematics, primes are something most people understand.
Continue reading →

Posted in Lesson | Leave a reply

String Versions of ctype Functions

Posted on October 17, 2020 by dgookin
Reply

The ctype functions are marvelous for single character manipulation and testing. Often, however, the functions appear in a loop so that they can be applied to an entire string. So why not write a string-based ctype function? Of course, that’s what I did.
Continue reading →

Posted in Lesson | Leave a reply

Post navigation

← Older posts
Newer posts →

Recent Posts

  • Extracting Data Chunks
  • C Blog 13th Anniversary
  • Colorful Data Chunks
  • A Little Bit Off the Sides – Solution
  • Working with Data Chunks

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