background top icon
background center wave icon
background filled rhombus icon
background two lines icon
background stroke rhombus icon

Download "C Programming Tutorial - 17 - Making Decisions Using if Statements"

input logo icon
Video tags
|

Video tags

language
for
beginners
youtube
thenewboston
lesson
bucky
tutorial
lectures
arrays
functions
pointers
structures
bangla
roberts
how
to
learn
education
class
C (Programming Language)
Statement
Conditional
Subtitles
|

Subtitles

subtitles menu arrow
  • ruRussian
Download
00:00:00
alright guys welcome back to another
00:00:02
tutorial and in this video we're gonna
00:00:04
be making our programs a lot smarter
00:00:07
than they have been because I'm gonna be
00:00:09
teaching you guys how to create a
00:00:11
computer program that can make a very
00:00:13
simple decision now the decision that
00:00:16
it's going to be making is we're gonna
00:00:17
give it some code we're just gonna like
00:00:19
print something out on the screen and
00:00:20
our program is gonna decide whether it
00:00:23
wants to run it or not and if you guys
00:00:26
are like ok it's a computer program it
00:00:28
does what I tell it to do so it has to
00:00:31
run it right well not exactly so let me show you guys
00:00:34
what I'm talking about I'll type the
00:00:36
syntax in right now and show you guys
00:00:38
the basic structure of it so what you do
00:00:40
is you type the keyword if and right
00:00:43
after that type parentheses right there
00:00:46
now in between those parentheses we're
00:00:48
gonna be giving it some sort of test and
00:00:51
we'll just make them really simple like
00:00:52
check if a number is equal to another
00:00:55
number or like check if one number is
00:00:57
less than another number so these tests
00:01:00
can be kind of confusing but I'm just
00:01:01
going to show you guys some real basic
00:01:03
ones for this tutorial
00:01:04
now after that put two little curly
00:01:07
brackets and any code that's in between
00:01:10
your brackets is going to run if that
00:01:13
test is true so again we're gonna be
00:01:15
putting the test right here and the code
00:01:18
we'll just write something simple like
00:01:19
print something out on the screen but
00:01:21
this is the basic structure of how to
00:01:24
allow your computer and make a decision
00:01:25
so I'm gonna go ahead and show you guys
00:01:27
the actual example so this makes sense
00:01:29
so like I said just test something
00:01:31
really easy like is the number four less
00:01:34
than the number ten well of course we
00:01:37
know that it is so in this case it would
00:01:40
run whatever code is right here like
00:01:43
print something out on the screen and
00:01:45
it'll just put like a easy us so
00:01:50
whenever you run this we see that it
00:01:52
does indeed print out so of course what
00:01:57
your computer did is it said okay you
00:01:59
want me to test this okay is for less
00:02:02
than ten yes it is run this so now let
00:02:04
me show you guys an instance where the
00:02:07
test would be false and I'll talk to you
00:02:10
guys about the different types of tests
00:02:11
that you can do well
00:02:13
of course right now you know that you
00:02:15
can do less than you can also do greater
00:02:17
than so let's do that
00:02:19
so this it says it's for less than ten
00:02:21
this one right here this does not equal
00:02:25
true for is not greater than ten so any
00:02:28
code that goes right here like printout
00:02:32
meatball if we try to run this we see
00:02:35
that it does not print out meatball so
00:02:38
even though we typed this line of code
00:02:40
right here in our program check it out
00:02:44
it doesn't print it out because we gave
00:02:46
it a test it wasn't true and it made the
00:02:49
decision not to run it pretty sweet so
00:02:53
before I show you guys at an example of
00:02:55
when you would actually use this in real
00:02:57
life instead just print out meeple on
00:02:58
the screen I'll talk to you guys about
00:03:00
the different types of tests that you
00:03:01
can use so of course you knew less than
00:03:04
greater then there's also greater than
00:03:07
or equal to and this case would be like
00:03:11
if you want to test as someone who's
00:03:12
like can enter a website their age would
00:03:14
be like greater or equal to 18
00:03:17
there's also less than or equal to in
00:03:20
some other ones let me go ahead and type
00:03:23
some numbers in here too and another one
00:03:26
that you can do is test if two numbers
00:03:29
are equal to each other now whenever you
00:03:32
do this you actually use two equal signs
00:03:35
you're like okay well in math class I
00:03:37
just write is X equal to ten or
00:03:40
something and the reason you don't use
00:03:42
one equal sign in computer programming
00:03:44
because remember whenever you're making
00:03:46
variables in assigning values to
00:03:48
variables you're at something like X is
00:03:51
equal to ten and one equal sign in c
00:03:55
programming means a sign of value to a
00:03:57
variable two equal signs means test if
00:04:01
one value is equal to another value so
00:04:04
again just remember that um you'll get
00:04:06
used to it after a while it's very
00:04:07
simple now the only other test I want to
00:04:11
talk to you guys about right now is this
00:04:12
not equals two it's basically the
00:04:16
opposite of equal to so in this test
00:04:19
right here whenever you want to test is
00:04:21
something is not equal to five it's
00:04:23
going to be true in every instance
00:04:26
five so this of course is basically the
00:04:31
opposite of equals equals to five is
00:04:34
indeed not equal to five that's true so
00:04:38
we ran this bit of code so let me go
00:04:40
ahead and show you guys an actual
00:04:42
example when you would use this and what
00:04:45
we can we can actually just code that
00:04:47
one that I just talked about we can
00:04:49
allow the user to enter their age and if
00:04:51
they're above 18 or if they're 18 then
00:04:54
we can allow them to enter some sort of
00:04:56
website but you know like what website
00:04:58
would the user need to be above 18 to
00:05:01
enter I don't know I can't think of
00:05:02
anyone but well code it anyways easy
00:05:05
caps lock
00:05:06
okay so int age and then we'll just go
00:05:10
ahead and give them some little prompt
00:05:12
on the screen printf
00:05:17
enter your age actually I want to ask
00:05:20
them a question how old are you uline
00:05:28
and of course if we're asking them a
00:05:31
question we probably should give them an
00:05:32
area to write into and this is just
00:05:37
gonna be a simple integer so percent D
00:05:39
and of course ampersand age so now we
00:05:47
have the users age which is some number
00:05:49
in the variable age so now we need to
00:05:52
make that basic if statement the test if
00:05:54
their age is above 18 simple enough so
00:05:58
if H is greater or equal to because
00:06:02
their members said they can also be 18
00:06:05
18 so this is gonna be true in anything
00:06:08
like 18 1984 it's gonna be false and of
00:06:12
course for 3 you know like a bunch of
00:06:15
three-year-olds use computer but anyways
00:06:16
let's go ahead and just print something
00:06:19
like prim you may enter this website
00:06:29
so we can go ahead and run this and
00:06:31
hopefully if it works how old am I
00:06:34
27 you may enter this website chello now
00:06:39
another thing that we can do is we can
00:06:41
also output something if they are under
00:06:45
18 in that simple you can just write if
00:06:48
and let me give myself a little bit of
00:06:51
space to work with right here so if H is
00:06:54
less than 18 what can we write just
00:07:03
write wholly nothing to see here
00:07:08
so run this and of course if we say
00:07:12
something like how old are you 86 it
00:07:15
still says you may enter this website
00:07:17
and nothing else and if you run this
00:07:20
again how old are you well I'm actually
00:07:22
only 6 years old nothing to see here so
00:07:26
pretty sweet our programs are getting a
00:07:29
little bit more interactive and actually
00:07:31
right now I guess this is a good time to
00:07:34
talk to you guys about nesting if
00:07:36
statements so actually put that in the
00:07:39
next tutorial so you know I don't want
00:07:41
to overlap overload your guys's brain in
00:07:43
this one so in the next tutorial I'm
00:07:45
gonna show you guys have nested if
00:07:46
statements make decisions like right
00:07:50
after another so it's gonna be awesome
00:07:51
thing guys for watching I'll see you
00:07:53
then

Description:

Source Code: https://github.com/thenewboston-developers Core Deployment Guide (AWS): https://docs.google.com/document/d/16NDHWtmwmsnrACytRXp2T9Jg7R5FgzRmkYoDteFKxyc/edit?usp=sharing

Preparing download options

popular icon
Popular
hd icon
HD video
audio icon
Only sound
total icon
All
* — If the video is playing in a new tab, go to it, then right-click on the video and select "Save video as..."
** — Link intended for online playback in specialized players

Questions about downloading video

mobile menu iconHow can I download "C Programming Tutorial - 17 - Making Decisions Using if Statements" video?mobile menu icon

  • http://unidownloader.com/ website is the best way to download a video or a separate audio track if you want to do without installing programs and extensions.

  • The UDL Helper extension is a convenient button that is seamlessly integrated into YouTube, Instagram and OK.ru sites for fast content download.

  • UDL Client program (for Windows) is the most powerful solution that supports more than 900 websites, social networks and video hosting sites, as well as any video quality that is available in the source.

  • UDL Lite is a really convenient way to access a website from your mobile device. With its help, you can easily download videos directly to your smartphone.

mobile menu iconWhich format of "C Programming Tutorial - 17 - Making Decisions Using if Statements" video should I choose?mobile menu icon

  • The best quality formats are FullHD (1080p), 2K (1440p), 4K (2160p) and 8K (4320p). The higher the resolution of your screen, the higher the video quality should be. However, there are other factors to consider: download speed, amount of free space, and device performance during playback.

mobile menu iconWhy does my computer freeze when loading a "C Programming Tutorial - 17 - Making Decisions Using if Statements" video?mobile menu icon

  • The browser/computer should not freeze completely! If this happens, please report it with a link to the video. Sometimes videos cannot be downloaded directly in a suitable format, so we have added the ability to convert the file to the desired format. In some cases, this process may actively use computer resources.

mobile menu iconHow can I download "C Programming Tutorial - 17 - Making Decisions Using if Statements" video to my phone?mobile menu icon

  • You can download a video to your smartphone using the website or the PWA application UDL Lite. It is also possible to send a download link via QR code using the UDL Helper extension.

mobile menu iconHow can I download an audio track (music) to MP3 "C Programming Tutorial - 17 - Making Decisions Using if Statements"?mobile menu icon

  • The most convenient way is to use the UDL Client program, which supports converting video to MP3 format. In some cases, MP3 can also be downloaded through the UDL Helper extension.

mobile menu iconHow can I save a frame from a video "C Programming Tutorial - 17 - Making Decisions Using if Statements"?mobile menu icon

  • This feature is available in the UDL Helper extension. Make sure that "Show the video snapshot button" is checked in the settings. A camera icon should appear in the lower right corner of the player to the left of the "Settings" icon. When you click on it, the current frame from the video will be saved to your computer in JPEG format.

mobile menu iconWhat's the price of all this stuff?mobile menu icon

  • It costs nothing. Our services are absolutely free for all users. There are no PRO subscriptions, no restrictions on the number or maximum length of downloaded videos.