All language subtitles for 16. Logical Operators in C Programming Language

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranรฎ)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

Welcome back, ladies and gentlemen.

Now, this video, we are going to take a look at how logical operators may be used in our C programming

language.

So logical operators.

Here we go.

We are going to start with our previous example, which says if we got 90 or higher on our last exam,

so let's write him down.

If we got 90 or higher on our last exam and and if we also have less than 50 bucks, if we have less

than 50 bucks in our wallet, then this case we can ask for some money.

Pretty nice example, don't you think?

So we've seen the logical structure behind it as well as the truth table behind the and logical operator.

And now we want to take a look at how it can be read them in our language.

So that's not a basically failed state man that we've seen in our previous examples.

Right.

Let's first of all, pronounce this condition correctly by specifying the exact two sub conditions,

these two operations we can see right here and then construct a general condition by using the logical

operator.

So the first condition is if we have less, if we have less, let's say that this the first condition,

if we have less than 50 bucks in our wallet.

And and the second condition is if we got 90 or higher in our last exam.

So when we pronounce it this way, we can hear that there is this and there is this and it which appears

between both of these sub conditions.

Right.

And this.

And Worthy's called the logical operator, which you already know this much.

Right.

I'm just just a quick reminder.

So if you want to construct some new condition, it will look something like this.

OK.

So let's say that we have two variables.

So let's say there is money and there is in grade at grade writing in grade and we use some messages.

So enter enter money and grade.

OK.

Very simple.

Then we use a scanner function to read these values from the user.

So percentage of the percentage there and we used here the money and the grade.

Nothing special so far.

Now if we want to ask the condition.

So we ask it this way if.

OK.

So they each statement.

And then we have money is greater.

It is less.

It's less than 50.

OK.

So if this condition.

This operand is true and right.

We need to specify something like this.

And grade is greater than 90.

Then do something.

Do something.

So this and here will not work in C language.

Right.

So instead of this.

And in C we use the double ampersands.

So simply using this way.

And it's equivalent, as you would have said in your language.

And so we use the double ampersands to indicate that.

If and only if both of these conditions.

Money is less than 50.

Great.

Is higher than 90.

Only if both of them are true.

The result of the condition of the whole condition will be true.

And then we will do something.

For example, ask for some money.

Is that clear?

So that's how you use the end logical operator.

And now let's move on to see.

How can we use the Aurora logical operator, which we've seen in our previous video?

We talked about it in general.

Now let's see how we can do it in our programming language.

So it will look something like this.

If money if money is less than fifty four or so.

Logically, it will be like this.

But since we are using our C programming language.

This will be slightly different.

And instead of this or word, we will use double vertical borrus.

Just like this.

So here you can see.

And even if the condition happens to be true, then we will do also something.

Right.

I'm just showing you the difference between the end and the war in C language.

So for the end logical operator, you use double ampersands.

And for the or logical operator, you use the double vertical borrus.

So this condition.

This whole condition will be true.

If either at least at least one of them is true.

So if this sub condition is true or this sub condition is true, or if both of them are true, then

the whole condition is going to be true.

And we we'll we are going to do something.

So that's something you can see.

And you remember when we talked about the truth table.

You can see.

What what will be the result?

Based on the status of the operands, so there is a truth table for each of these logical operators.

And lastly, what we have is the not logical operator ending sea land, which is the logical operator

not is specified as an exclamation mark.

So it looks just like this, OK?

It looks just like this.

This bottom body here.

This is the knot in C language.

So if you put these exclamation mark before any condition, it will simply take the result, whether

it was true or false and just reverted.

So, for example, if we have the following condition, let's say if greyed is greater than 80, then

print some nice message and print half a good job message.

So good job.

OK.

So if this condition happens to be true, in rate is higher than 80, then you're going to run these

command.

But if you put an exclamation mark, let's say right here, I can add another parentheses.

Then in this case, whenever a grade is higher than 80, the overall result that should have been through

will be false.

And vice versa.

Simple as that.

So.

So now these good job will be executed only.

OK.

Because we used here the not logical operator.

It will be only executed.

One grade is less or equals to 80.

So I hope you got the point of how the not logical operator works.

You simply have a trial.

And if the result of the condition is true and you put a knot on it, then it becomes false and vice

versa.

OK.

So that's basically a very summarized tutorial regarding logical operators.

Basically, all the operators, logical operator are saying relational operators like equality in equality

more than less than.

And so on.

All of them are very important.

And you need to know how to use them for almost all of our upcoming sections.

So that's a lot of these video guys.

Thank you so much for watching.

And I'll see you in the next video.

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.