C Programming Tutorial For Beginners

Gonna give us 37 as you can see we can do another one which is called floor and floor we’ll do.

The opposite so floor we’ll just round the number down no matter what so if I have like.

36 point six five six this will round it down to 36 so there’s all sorts of little you know things we can do little functions that we can call and get information about numbers and like I said these functions will either like modify a number so it would.

Like give us the floor or the ceiling or sometimes they’ll like give us information about numbers so that’s sort of the basics of working with numbers you know you can do all sorts of math with numbers you can add in some to multiply and you can even multiply add subtract integer numbers and floating-point numbers so play around with all these different things with numbers and if you.

Want to find some more of these little math functions all you have to do is just go online and Google search for C math functions there’s like dozens of these little functions that you can use but I think these are some of the most widely used in this tutorial I want to talk to you guys about using comments and see well comment is a special block of.

Code and see which actually gets ignored when we run our program so if you want to write a comment you can use a special starting and ending tag and.

Any of the text any of the code anything that you put inside of that tag isn’t gonna get executed or really looked.

At by C so we can use comments to.

Do all sorts of things you know you can leave little notes or little comments inside of your program you can use comments to temporarily disable certain lines of code they can.

Be really useful so I’m gonna show you guys the.

Basics down here in my program if I want to create a comment I can start a comment using a forward slash and an asterisk and you’ll see when I put this asterisks in all the code in my text editor changed color and basically what this means.

Is anything that comes after this forward slash and Asterix is gonna be considered a comment in order to close off the comment I can use an another asterisk and.

Another forward slash you’ll see the code changed back to normal code inside of these two asterisks is I can basically write out anything I want and it’s gonna get considered as a comment so for example if I you know wrote out like my program and I ran my program this whole thing is gonna get ignored by C so it’s just gonna print out comments or fun it’s not gonna do anything else and you know like I said comments are really useful so I could leave a little note up here I.

Could write something like to do like I have.

To do something and a lot of times people we use comments to explain certain lines of code so I could.

Put a comment here and I could say like this print out text right so maybe you know this was like a really complex line of code we could use this text in order to explain it you can also use comments to do something called commenting out a.

Line of code so for example let’s say I wanted to run my program but I didn’t want to have this line of code in there well one thing I could do.