All language subtitles for 6. Print the Multiplication Table of a number - Solution

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

All right, so what do you have to do in this exercise, in this exercise, what you have to do is just

to use some sort of, let's say, multiplication table for a given number and a multiplication table

for a given number is very simple.

And it will be divided in our solution into two main steps, that the first step will be simply to receive

one number.

OK, just received some number and print all of the results from one up to 10.

OK, just another multiplied by one print.

The result take two multiplied by num and print the result and so on up until 10.

Nothing complicated, but basically that's the main steps that we will need to do in this kind of solution.

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

OK, just the usual process.

Let's print a nice message, enter num, read the noun value from the user, and later on let's think

about the solution.

What should be the trivial solution for this example, for this step.

So if you are not familiar with loops, probably what you are going to do something like that.

Right?

We know that we will need like 10 printing operations.

So print out and it will be, I don't know, percentage.

The multiplied by one equals two percentage gain.

There you go.

And instead of the first percentage, then we will simply use.

And here we will use num multiplied by one.

OK.

Is that clear so far.

So we simply use these multiplication and let's now just copy it ten times.

Right.

And just I just want to show you guys how it can be done.

So two, three, four, five, six, seven, eight, nine and 10.

And again, here are two, three, four, five, six, seven, eight, nine and ten.

OK, so we simply use 10 percent of lines to bring the result.

So let's try to build and run it.

Let's see if it works.

So enter number three.

OK, what what do you.

What did we forget?

We forgot a new line.

So backslash in here.

Let's copy it.

Backslash, backslash and backslash and so on.

Just adding the next list and character that Adam that Adam.

And now let's build and run it once again.

So enter now three and yeah, awesome.

It seems to be working correctly.

We simply print all the values of these multiplication table four of these given number three in this

case.

So three multiplied by one, three multiplied by two, three multiplied by three and so on.

Up until three multiplied by ten.

And of course, this solution works OK, and there is no problem with that, but that was the first

step and it's also optional to use it without the loop, right?

It's also optional.

But the question comes here.

Let's say that we want to upgrade to these programming, to print all the values from multiplying number

by one by two up until ten thousand.

OK, so what will you do, guys?

Will you simply take this and copy that?

I don't know what like this.

Copying it 10000 times and modifying everything manually.

This will work.

But but can you agree that it will be so messy?

It will be so I don't know.

It's so hard to maintain so long it will take you to complete this program.

So I think that's a problem.

And also another problem is that let's say we want to make this step to OK, which says the following

step two, step two will get you will get here now.

And let's say you multiply Chaytor, we'll call it multiplication and you will simply need that.

Your program will print all the values like this.

So now multiplied by one now multiplied by one now multiplied by two up until this given number, multiplied

by these multiplied cater multiply chaytor.

OK, so that's will be that will be a problem.

I don't think that's even possible.

There are a couple of tricks that it can be done, but simply how can you print in advance all the lines

of code up until this multiplication?

You you don't know if it will be five, six, maybe 10.

So the right approach to solve this exercise would be to use the loops.

And if we want to use loops, probably the better idea here will be not to use a do while loop for a

while loop it will be to use for a loop.

So in time, OK, so if we know that we are going to use the for a loop and we know that this loop is

going to start from one up to ten, let's do it just up to ten in this example, the first step.

So from one up to ten.

So we know for I equals to one I is less than or equal to numb.

Right.

Or to ten in this case.

So from one to ten we are going to increment at the end of every iteration I buy one and to print the

results to the screen.

So let's just simply copy that and modify it a little bit.

So it's going to look like this.

So percentage then multiplied by percentage D equals to percentage B, but instead of the first percentage,

do we know it will be NUM instead of the second percentage, instead of the second placeholder, it

will be I.

And finally it will be these percentage.

They will simply print num multiplied by I.

OK, so if basically all of these for a loop and these primitive lines, it's kind of one in the same

thing guys, because you can see instead of these percentage, then the second percentage that we used

here manually to write the number itself and here in the multiplication also now we simply modified

it and we said let's use a placeholder instead of this.

And these placeholder will have the value of EI, which is basically a variable that changes on every

duration and getting increment and by one at the end of every iteration.

So let's try to build and run it.

So go here, build and run internally.

And yeah, there you go.

You can see from one to ten printed all of them inside of the for a loop as part of the for loop.

And also there are from one to ten printed as part of just the printing lines.

So yeah that's amazing.

That's good.

And now what we will have to do is simply first of all let's remove that is to upgrade this program

to support the second step of getting numb and a multiple locator and printing from NUM from one up

to multiplication are all the multiplication table of num.

So let's create additional variable, call it multi, please multiply Keiter.

OK, and these multiplications are also we will get it from the user, so let's use it like this.

So print f enter the multiple.

Dramatically greater and read the value here story inside of this variable, and now the only thing

that will do that we will need to modify for the second step is just this stopping condition of the

for loop.

So now, instead of executing all of the multiplication operations, we will up until 10, we will just

modify it and use here and multiply Katar.

That will basically specify what will be the stopping condition.

So let's just show an example and let's say that was the problem multiplied Kether, multiply Chaytor.

OK, so what is the problem?

Let's see, multiplications are undeclared.

Why is it undeclared?

Multiple Chaytor Because it's more mollet multiplication or it should be OK.

So now it should work.

So let's just call this one.

I don't like it here.

Let's close it.

Let's build and run it.

And what's going on.

OK.

So here is our council.

Enter Annam three.

Enter the multiplication.

Let's go with 12.

So three multiplied by one.

By two.

By three by whatever.

You print all the multiplication table of a given number up until a given multiplication.

So let's say we wanted to go with five and we wanted to print all the values.

Five multiplied by one by two up until, let's say a thousand.

A thousand.

So it goes like this multiplied by a thousand.

So you can see all of the printing lines of code or game console.

They didn't show it, but all the printing operations are actually there.

And you just print all the values of these given no up until your multiplication.

And yeah, that's basically a part of bigger programs that use multiplications and use multiplication.

And yeah, I think this is through these video.

Guys, thank you so much for your attention.

Keep them practicing and you are bound to succeed.

I'll see you next time.

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