# Calculating the Standard Deviation

## Difficulty: ★ ★ ☆ ☆

Even when statistics has barely brushed by you on the subway, you probably know the term standard deviation. It refers to how data is distributed in a group, their distance from the mean. You can use your C programming kung fu to code the standard deviation of a data set, which is the challenge for this month’s Exercise.

# Calculating the Absolute Value

## Difficulty: ★ ☆ ☆ ☆

I started my technology writing career at a computer book publishing house, CompuSoft. It’s no longer around, but I do recall ghost writing books such as the BASIC Handbook, which was an encyclopedia of the BASIC programming language. The first command listed in this book was ABS.

# Calculating the Subfactorial

## Difficulty: ★ ★ ★ ★

Calculating a factorial is a common programming exercise, often coupled with introducing the concept of recursion. Mathematically, the factorial has a twin: the subfactorial. Its calculation can be a fun programming challenge, which is the subject of this month’s Exercise.

# Positive Negative Positive Negative

## Difficulty: ★ ☆ ☆ ☆

One of my pastimes is watching math videos. I was a terrible math student, but I enjoy the videos. Occasionally a concept is presented that I can program in C. This month’s Exercise covers one of these concepts.

# The swap() Function

## Difficulty: ★ ★ ★ ☆

Swapping values is common task in computer programming, often used when sorting. You need the value of variable a in variable b and vice-versa. A number of methods are available for swapping, most of which involve using a temporary variable to hold one of the values during the swap.

# Tetration

## Difficulty: ★ ★ ★ ★

Tetration is a mathematical process that generates obnoxiously huge numbers quickly. It’s exponentiation on overdrive. The concept is insane, but it’s also something you can code in C.

# Numbers with Unique Digits

## Difficulty: ★ ★ ★ ☆

I’m sure some eccentric term exists to describe a number where no digits repeat. Whether this concept has any mathematical relevance remains uncertain. But it’s the type of problem you can easily solve by writing a computer program.

## Difficulty: ★ ★ ☆ ☆

Probability. Odds. These are words I often confuse, but the similarity relates to how often things happen. The gold standard is the flip of a coin: two possibilities, heads or tails. If you don’t understand how it works, you can write code to drive home the point.

# Finding Characters

## Difficulty: ★ ★ ☆ ☆

When I was working on last month’s Exercise, I scoured the C library for a function that returned the number of specific characters found in a string. The closest I could find was strchr(), which returns the location of a given character in a string. You can set this function in a loop to find subsequent characters, but what I needed was a tally, a total count of all matching characters in the string.