To Zero and Back

Many first-time programmers rush over variable type descriptions and head full-bore into coding. That’s fine. I did it. You probably did it. But eventually you encounter code that doesn’t work properly because of negative numbers. That’s when you go back and review the concept of negative integer variable types.
Continue reading

The pow()erful Function

When I first learned the C language, I was surprised to find something missing from its assortment of operators. The +, -, *, and / operators are pretty common for nearly all programming languages. And you’ll find the % and ! operators used for modulus and logical NOT in a few programming languages. Yet what other languages have that C lacks is an exponent or power operator.
Continue reading

A Solution for 100 Doors

When I code a program, I start out by slapping together the various elements. I setup the variables, I write some quick routines, and I add comments to the tune of /* Do something here*/. With those bricks in place, I go back and fill in the mortar to make it all work. If the code runs, great! That rarely happens, so more work is involved.
Continue reading

The Problem of 100 Doors

Plenty of interesting and fun programming puzzles are available to test your skills. Some of these puzzles come from the realm of mathematics or logic. What those propellerheads do with the solutions is up to them, but often you can code such problems to help you learn more about programming. One such logic problem is called 100 Doors.
Continue reading