C Programming Tutorial For Beginners

Gonna make , and I’m just gonna type out.

The name of the variable that I want to be placed inside of here so I’m just gonna.

Be character age and we’re going to do this one more time down here I’m going to type percent D and character age so essentially what I’m doing is I’m printing out the value that’s.

Inside of character age where I specify this placeholders so let’s go ahead and run our program and now you’ll see it’s gonna look exactly.

Did before it’s the same story the same name and the same age except I didn’t have to actually type out the character’s age and the character’s name inside the story I just referred to the variable and what’s cool about variables is I could come up here and let’s say I wanted to modify the character’s age all I would have to do is modify it in this one spot so we could change the characters a name to like Tom and we could also.

Change their age to like 67 and now when I run my program all of that’s gonna get updated in the story so now it’s using the name Tom and the age of 67 in our case we only mention the character’s name and the character’s age a couple times but you can imagine if I was mentioning this variable like ten or twenty or thirty times having to change it in each one of those individual spots.

Would be extremely difficult.

So variables are great because we can store the value one time and then if we want to modify it we just modify it in one place so another cool thing that we can do with these variables is we can actually modify them so let’s say that halfway through the story I wanted to change the character’s age I could actually come down here I can make a new.

Line and right above these print statements I could give this variable a new value so I could say character age and I can just set it equal to something else so we can set it equal to like 30.

And again we want to include that semicolon so now halfway through the story the characters age is actually gonna change so you’ll see it says there once was a man named Tom he was 67.

And then down here the age is being a 30 so we.

Actually modified the value that was stored inside of the variable halfway through printing out our story and that’s really why variables are useful so that’s kind of a basic overview and introduction into what variables are why they’re useful how we can use them and over here again we’re storing a collection of characters which.

Is called a string and we’re also storing this integer but there’s some other data types that we can also represent so in addition to representing like a string.

Do some other stuff as well and I’m going to talk about that in the next video but for now this has just been a basic overview and introduction into.

Variables and see in this tutorial I want to talk to you guys about data.

Types in C and in the C programming language we’re gonna be dealing with a lot of data so generally when you’re writing programs you’re gonna be dealing with all sorts of information and in this tutorial I just want to.

Talk to you guys about what types of information we can represent and use inside of our C program and these are.