C Programming Tutorial 29 -Variables

Did you read the last blog on the bool Data Type? Are you new here? Start at the beginning, Intro to C!

Let’s talk about variables! Now, I know, we’ve said a lot about variables, so this video is going to be pretty short.

The first thing I want to make sure you guys are clear on is the difference between defining a variable and initializing a variable. We can define a variable like this:

Continue reading “C Programming Tutorial 29 -Variables”

C Programming Tutorial 28 – The bool Data Type

In the previous video we learned how to use the _Bool data type. I recommend you read that blog before you read this one as it has fundamental knowledge that will help you here. Read it here! Are you new here? Start at the beginning, Intro to C!

If you’ve noticed, it seems that all the data types in C are lower case. We have int, double, float, char, but this _Bool had to go ruin everything for us.

Continue reading “C Programming Tutorial 28 – The bool Data Type”

C Programming Tutorial 27 – _Bool Data Type – Part 1

Don’t forget to read the last blog on the ASCII and Int Conversion! Are you new here? Start at the beginning, Intro to C!

In this video we are going to be discussing Boolean data. Boolean data is anything that is either true or false.

Now, if you remember back a few videos ago when I started talking to you about binary, I mentioned how a single bit can be either 1 or 0. It works pretty similar with a Boolean variable.

Continue reading “C Programming Tutorial 27 – _Bool Data Type – Part 1”

C Programming Tutorial 26 – ASCII and Int Conversion

Don’t forget to read the last blog on the Char Data Type! Are you new here? Start at the beginning, Intro to C!

In the last two videos I’ve laid the foundation for understanding character data and integer data. Be sure to check those out.

In this blog we are going to be writing a program that will take a character and convert it to an integer.

First, we will cover how to convert from ASCII to an integer. Then, we will convert it back.

Continue reading “C Programming Tutorial 26 – ASCII and Int Conversion”

C Programming Tutorial 24 -ASCII

Don’t forget to read the last blog on Format Characters for Float and Double! Are you new here? Start at the beginning, Intro to C!

We are now going to begin our discussion of the char data type!

Now, char is short for character. A character is any number, letter, or symbol that can be used on a computer. That’s not all of the characters, though. There are actually some characters that do certain things. For example, there is a tab character, there is a newline character, there is a space character, there is even a null character.

Continue reading “C Programming Tutorial 24 -ASCII”

C Programming Tutorial 23 – Format Characters for Float and Double

Don’t forget to read the last blog on Scientific Notation with Floating Point Numbers! Are you new here? Start at the beginning, Intro to C!

Our program starts with a hardcoded floating point number in scientific notation and outputs that number in decimal notation. What I want to do is explore some of the other ways we can format this data and also how to take the input directly from the user rather than hard coding it.

First, let’s learn some format characters.

%f – display the number in decimal notation

%e – display the number in scientific notation

%g – let the computer decide how to format it

Continue reading “C Programming Tutorial 23 – Format Characters for Float and Double”

C Programming Tutorial 22 – Scientific Notation with Floating Point Numbers

Don’t forget to read the last blog on Int, Float, and Double Data Types! Are you new here? Start at the beginning, Intro to C!

Now that you’ve seen the basics, it’s important for you to understand how floating point numbers are actually stored. Floating point numbers are stored in scientific notation.

If you need a refresher on scientific notation, that’s fine. Essentially, we can represent a number as multiplied by 10 to some power.

So 24000 becomes 2.4 X 10^4 = 24,000.

Continue reading “C Programming Tutorial 22 – Scientific Notation with Floating Point Numbers”

C Programming Tutorial 21 – Int, Float, and Double Data Types

Don’t forget to read the last blog on data types! Are you new here? Start at the beginning, Intro to C!

Now, we’ve discussed data types some, but this video is going to be devoted to discussing numeric data types. Numeric data types are used to describe numbers. So any number in our program can be classified as one of many numeric data types.

There are a ton of numeric data types, but most are just modified versions of the three main numeric data types: integer, float, and double.

int stands for integer. Integers are whole numbers, that is, any number with no fractional part. Integers = {…, -2, -1, 0, 1, 2, …}.

Continue reading “C Programming Tutorial 21 – Int, Float, and Double Data Types”