All language subtitles for 8. Challenge 1 - Solution 2

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

So this exercise should be very easy and intuitive for you.

And actually, I hope that you get this video after you've tried to solve this exercise on your own.

You gave it a shot.

You tried to run some commands, even if that doesn't seem to be working out as you expected.

You tried to fix some bugs.

You tried to run these code once again.

And that's OK.

Don't be afraid of it.

That's how we learn, guys.

And now let's go over this solution together.

Basically, this exercise is pretty straightforward.

First of all, we need to understand first the difference, the difference between what is an odd number

and what is an even number and the rule to find it out is as follows.

Basically, if if the number.

All right.

If the number can be can be divided.

I'm writing eating the comments here can be divided by two without a remainder.

Without a remainder.

All right, then.

In this case, the number is going to be an even number.

All right.

And even one.

And even number.

Otherwise.

Otherwise, if the number can not be divided.

If the number can not be divided.

Divided by two without a remainder.

Right.

Without a remainder, then this number is going to be an odd number.

And that's basically the whole difference between these two types of numbers and even number in and

an odd number.

So, for example, if we have for a let's say, for example, example, if we have four, 10, 20,

you know, something like that.

All of these numbers are even because they can be divided by two without having a remainder.

All right.

So all of these numbers are an example, two and even number, even numbers.

And for example, if we have for another example, if we have, let's say, five in 1927, these are

numbers which are odd numbers, because every time, if you will try to divide them by two, then you

will always have a reminder of one, right.

If you divide five by two, then you will get a result of two.

And a reminder of a remainder of just one.

All right.

So these numbers are odd numbers.

So now we know how to classify between odd and even numbers.

And pretty much, I guess you got the idea.

It's not so complicated for those of you who are not so familiar with what are even numbers in odd numbers.

And let's dive to writing or a code in C.

So for that, let's first of all, create.

All right.

Are we I think I will remove these comments that they will not bother you.

I guess you wrote them down also.

So first of all, let's create a variable now.

End now.

All right.

And then we are going to display a nice message.

Print F enter.

Enter a number.

Right.

And then you go scan F percentage D and we are going to read a value to read an integer value and put

it inside in a variable.

And up until this point, everything is similar to the previous sections and exercises that we've seen

so far.

So now we are going to insert our F condition and we are going to use it if.

And here we are going to specify the condition of the checks.

If if the division of NUM over two has a remainder of zero.

And if that's the case, we know that NUM is even.

All right.

So we are going to print a corresponding message.

So print F percentage the is even.

And the backslash.

And here.

And instead of percentage the.

We are going to replace it with the value of nom itself and semicolon in the end.

And the if the conditional result is not true.

All right.

If there is still a remainder.

If we do.

If we divide num by two.

But we got a remainder.

So we use the.

Else section.

And if that's the case we are going to print that phenomena.

Self is odd.

All right.

So percentage the is odd exhibition at the end.

Now pretty much the same line as we of the used right here.

And there you go.

We've written a program that checks.

If a number is even or odd.

And based on the result of the condition, it brings out a corresponding message.

So let's try to run this code.

Let's build and run it.

All right.

There you go.

Enter a number.

Let's see.

We know that, for example, ten should be an even number.

Enter number ten is even rate.

And now let's.

Tried to use something that is odd, for example, five.

There you go.

Five is odd.

All right.

So basically, that's it.

We could just maybe add some message here.

Nahm is an even number to make it more clear.

No.

And also now is an order.

No, just some formality.

All right.

So this is it for these video guys.

And we checked just to summarize everything up.

We checked it.

The remainder is zero.

And based on the result we've printed out.

That's that number is an even number.

Otherwise, it's an odd number.

Another solution.

I will just put it here.

Let's copy and paste that we could have checked if the number has a remainder, which is not zero.

And if that's the case, we are going just to switch places between the print F commands and print that

the number is odd.

Otherwise, it's even even not even.

So that's at least part of code and this part of code.

Basically, they do just the same.

It's just that the condition is formulated a little bit differently.

Here we check for the quality.

And here we check if it if the remainder does is not equal to zero.

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