Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranî)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
Oh, wow, that's a nice example in this exercise, what we are going to do is to write some code that
is responsible for printing the multiplication table, just like the one you've learned when you were
about six or seven years old.
And we are going to write this multiplication table from one to ten, I think will be enough.
OK, so that's what we are going to do.
And we are going to solve this exercise by using none other than our two dimensional array.
So I hope you're ready and let's go.
And first thing that we have to do here is to define some size.
OK, so let's give here like a size, OK?
And the size will be of a size 11.
And I will explain you right away why we use here 11 instead of 10.
And basically, just a quick reminder to you guys, whenever you will see size in our program by using
these define it will be replaced even before the compilation phase.
It will be replaced by the value of eleven.
So since we know that we are going to work with two dimensional arrays, probably we are going to iterate
over each of them ever.
We are going to iterate over the rows and the columns.
So for that, we've seen in the previous exercise that we are going to use and I and J for that.
OK, and also what I want to do is to create or basically initialize our metrics, our two dimensional
array with the size of size by size.
It will be a square square, two dimensional array, just like we would have expected of a multiplication
table.
And now what I want us to do is to started from our equals to zero as long as I is less than size,
iterating over all the rows and now inside it, we are going to iterate over all the columns right so
close to zero G is less than size and J plus plus.
And what we are going to do right now is to specify we are basically going first of all, to feel OK,
so let's call this step.
That will be our first step.
So step number one.
Step one is to feel the values in the table.
OK, so that will be the step one.
And we will feel the values because first of all, now we just declared it right.
It's not initialized.
So we are going to feel the values and we can say that the matrix OK, at Index I j at Index I j meaning
the value of the element at Row II and column J will be equal to I multiplied by J.
OK, that's how the multiplication table works, right.
You take the value from the row and multiplied by the value of the column.
So very simple.
And the only thing that I want to mention here is regarding the size of eleven.
I mean, why would I define it of size 11?
And the reason is very simple, because if we start on both of these of loops from zero, then we know
that we will get like zero values at the leftmost column and the upper row will be also zero is because
everywhere that I is going to be equal to zero in J will be equal to zero, you will simply get a bunch
of zero soon.
You may also try it, but the result will be very disappointing.
But let's let's also give it a shot that you will understand exactly what I meant.
So let us proceed and go like this.
So for OK, now basically we are going to do step two and this step is printing the multiplication table,
multiplication table.
So that's what we are going to do.
So for I equals to zero as long as I is less than this size, I plus plus in here, what we are going
to do is to print these, these two dimensional array just like we've done in the previous video.
So four J equals to zero as long as is less that size J plus plus.
And here we are going to use print F and we are going to specify here percentage and specify the value.
OK, let's just use some space here.
Specify the value of a at index.
I hate index cymatics index I and index J.
OK, row I.
Index wrote a column J and awesome.
And once we are out of these.
Look, we are going to print in your line so that it will look like a real two dimensional matrix and
now what we are going to do is simply to build it and run it and let's see what we have here.
So basically, as you go, you can see here like these kind of two dimensional array, but things are
getting a little bit out of balance here.
So let's just add some R representation here using these four or maybe even maybe even five, we let's
use five that we will see it real nice.
OK, so there you go.
Let's just increase the size.
OK.
Awesome.
Awesome, awesome.
So there you go.
You have your multiplication table.
And one thing that I don't really like here is these zeros and these zeros.
And they happen due to the fact that I start from zero in just hours, from zero.
So what I suggest to do is to start both of them from one and start this also from one.
And this way, if we're building run it, we will see something very, very beautiful.
We will see actually the multiplication table that you have been seeing probably when you was when you
were like six, seven years old.
So one multiplied by one is one.
Two multiplied by one is two, let's say five multiplied by two is ten.
And you go like this, five multiplied by four is twenty.
And you have created your OK, that's yours guys.
You created your first multiplication table and it's actually looking amazing.
And what's what's the best part here is that you can also let's say you wanted like to increase the
size of this multiplication table and let's say you wanted to go like with twenty.
So you will just build and run it and let's increase it to the fullest.
And there you go.
You have a multiplication table of twelve twenty by 20 so you can increase it however you like.
You have two dimensional array, you have a full control of its size, its number of rows and arrows
and you know how to set and to feel its values.
And you also know how to print all of its values.
So pretty awesome.
Guys, I think you are starting to get the feeling of how to work with two dimensional arrays.
That's very important.
It's a very useful topic.
He used a lot in even even even in tech interviews.
And also on your exam, it may be used if you are studying this material in these course.
So I think this is it for these video guys.
Let me know what you think of it.
If you have any questions, feel free to ask.
And until next time, I'll see you there.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.