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
So let's start solving these exercises together and we will simply print a nice message to the user
so it will go something like this.
So print enter a three digit number.
OK, so then the user is going to insert his number and we need to store it inside of, let's say in
some.
So print F, enter a three digit number and read it using this kind of function and store it using the
percentage placeholder stored inside the variable name.
So that's basically the first step.
And now that we have to do, we will assume that the user will not insert, you know, five or ten or
ten thousand so that the calculations will be OK.
And now what we have to do is to calculate from this naoum to extract the units, the tens and the hundreds.
So for that, we have to create for example, let's say there are three additional variables.
Of course, it's not mandatory.
We can also just use it all of these calculations in the printing line.
But still, I would like to do that.
So let's do it like this in two units, towns and hundreds, hundreds.
And now let's say we had our example like five, three, one.
So in this case, we know that units will be equal to one.
Tannen's will be equal to three and hundreds on the brands will be equal to five.
OK, just like that.
And now what we have to understand is simply to take this information.
OK, so we know that units will be equal to one, which is the rightmost digit in a three digit number.
So how should we get the units out of this number?
What do you think, guys?
Take a second to think about it and pause the video.
And once you're back, let's continue to talk about it so the units can be calculated in a very easy
approach.
We can say that if we take this number and we use a remainder and divided by 10, for example.
Right.
Then if we just divided by 10, we will get 53.
OK, but if we divide it with the remainder by 10, we will simply get the remainder of the division
operation of five hundred thirty one by ten.
So it will be simply one.
So we simply take none and use the remainder divided by 10.
So units equals to num modulo tenth.
And now what we have to do is for example, to let's calculate the hundredths.
So the hundredth is the leftmost digit and the hundredth is how many hundreds.
Full hundreds.
Do we have in a three digit number.
And that's also not complicated.
You simply take num in divided by 100.
So how many full hundreds will get into num.
This will be the hundred digits.
OK, so in this case if we divide five three one by one hundred we will get five.
OK, so units we got it on rest.
We got it.
The only thing that remains for us to calculate is the Tannen's digit.
So how basically should you approach it?
So there are actually a couple of ways to calculate it, to calculate this middle digit.
One of the ways is simply to do the following.
Let's say if we take five, three, one and divided by 10.
OK, so for example, if we divide it by 10, we will get what will we get?
We will get fifty three.
Right.
And if we have fifty three, we know how these rightmost character can be calculated.
Right.
Just by using this model.
Lutin the remainder of the division by ten.
So we simply may say that Towne's will be equal ok to num num num divided by ten.
OK, which will give us the total amount of full 10th that this number represents.
And this value will simply use a remainder of ten to find the right most digit inside of it.
So I hope that's clear.
You have to find the units of tens and the hundreds and now all that is left for us to do is simply
print the result to the screen.
So how will you do it using the printed function?
The total sum of digits in percentage in a given NUM is percentage.
So the first percentage of the first place home.
There is the numb, right, because we describe it so now and afterward, and we have another tragedy,
which will simply be the sum of units, tens and hundreds, which will be just like this, tens and
hundreds, hundreds and hundreds.
OK, semicolon in the end.
So let's try to build and run it and see what happens.
So build and run it, enter a three digit number.
So in our example, what did we have?
How we have five three one.
So the total on some of these digits in five three one is nine exactly as we expected.
Five plus three is eight plus one is nine.
Let's use additional example and simply use here, I don't know, two hundred forty seven and the total
sum of digits in two hundred forty seven is thirteen.
Just let's make sure of it.
Two plus four is six, six plus seven is 13.
So it seems to be working properly, correctly.
And I hope that all the steps here, I tried to do my best to make them as practical and understandable
to you guys as possible.
So, yeah, I guess this is it for this video.
Very important to understand the concepts of the concept of unit stands and hundreds.
It will guide us during these chorusing additional exercises in more complicated topics, in more advanced
topics.
But if you will understand the main principle in the main concept of how you should work with them at
this moment, there should be actually no problems later on.
So thank you guys for watching.
If you have any questions, feel free to ask them.
My name is Vlad is Alphatech, and until the next video, until the next exercise.
I wish you a great day.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.