All language subtitles for 3. Congratulations In C - Complete Usage Of Conditions In C Programming

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
hu Hungarian Download
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

What is going on, guys?

And now that you are familiar with what are conditions and what they are used for, let's see how we

can use them and implement them in C programming language.

Let's start with our previous congratulations example, where we have to get a grade as an input.

And if these grade equals or higher than 60, then we just printed out congratulations.

Otherwise printed out a field.

Try again, Masad.

And if we know that we write these programming C language, let's first of all start with our well-known

pirates.

So let's use the includes include SDD, TDA, old age and include SDD Liebe.

These are basically the two default included that we've seen in code blocks in our code examples in

the previous videos.

And now we also know that we need some starting point.

Right.

Perhaps we can also write these main thing.

Already there int Main and the curly brackets to hold the block of commands.

Great.

And now we know that we have to get the grade as an input from the user.

So let's first of all declare these variable use in to grade.

We created a variable called the gradient.

And these of type end.

And then we will simply read the value from the user using scan F and hold this value inside of these

variable.

And up until now, everything seems to be as usual and write nothing new.

So I think that's the time we should add the condition.

And actually, that's pretty simple.

We just write the EEF statement and after war, as we specify the condition in the parentheses.

So the condition in this case is simply if greyed equals or higher than 60.

And now we can specify the commands that should be executed once the condition happens to be true.

So in this case, we should simply use the printf command to just display a congratulations message

on the screen.

If the grade is actually higher or equals to 60.

So that's all good and nice.

And if we currently build an R&D program there, this program will be just capable of printing.

Congratulations.

Message only is the result of the condition is true.

If the result of the condition is false.

All right.

So basically nothing will happen here.

The program just will read that the value from the user.

But it will not print anything to the screen.

You may try to ram this code at home.

Simply enter, I dunno, 50 and see what happens in the.

You probably will see that nothing will happen.

So that's why you would like to specify in the condition itself what commands should be executed if

the result of the condition is false.

Right.

We have here what will happen if the result is true.

If the if the result of the condition is true.

We also want to specify what will happen if the result of the condition is false.

So how can we do it?

How can we print the field?

Try again.

Message to the screen.

If the condition is false, it simply should add the else section, meaning all the commands that will

happen if the grade is less than 60.

So then you will just print fail, try again.

And there you go.

And actually, that's pretty simple, right?

Nothing complicated.

Just an F and a bunch of commands and that may be executed based on the result.

If it's true and an ls the some other commands that that may be executed if the result of the condition

is false.

So now I want us to get over this code line by line and make sure that we fully understand its flow,

meaning what lines are going to be executed before and after and simply how the the program that your

computer is going to execute these code.

And before you finish.

Just don't forget to add the return zero at the end to specifying that there that the program has been

terminated.

Successful.

All right.

So the steps are as follows.

We, first of all, start in the main block.

Then we declare our first variable, the integrated.

Then we read the value from the user by using the scanner function.

And let's say that the value in this case was, I don't know, something like 90.

And now we should just use the condition.

And ask QIf grade is greater or equals to 60, which happens to be true.

And if that's the case, we print that congratulations message to the screen.

And then, of course, we skip the LS part because it should only be executed when the condition is

false.

Which is not the.

Case, and you just returned the zero.

And there you go.

That was basically the flow for how your computer will execute this code line by line if the grade received

from the usery will equal to 90 in this case.

And now let's take a look at the flow of the program.

When we receive a grade that is actually less than 60.

So you create a variable as previously.

And then you read the value of the grade, which in this case, we assume that it will be just fifty,

let's say.

And then you come to the conditions section, which in this case happens to be false.

Right.

Fifty is not greater than 60.

So if it's not true, you don't run the print.

Congratulations.

Message through the screen.

You simply move to the yellow section.

And now you execute the commands of the else block.

You simply print failed.

Try again message.

Then you move on to the return zero.

And there you go.

Your program is complete.

So that basically was, guys, the second flow of how the computer will Iran this code.

If a given grade from the user is actually less than 60.

So we will not run.

It will not execute the code under the EEF section.

It will simply go to the else and just execute the print command stated there.

So, no, you know, the flow of your code when using control flow mechanism.

It's a very important concept, guys.

And I'm glad that now you know, the general concept as well as how it is being executed and implemented

in C programming language.

I wish you good luck in this section.

And I'll see you in the next video by.

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