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
What is going on, guys?
And welcome back to another exercise in our amazing programming course.
And in this exercise, what we are going to do is simply to write a program that will receive a number
with three digits, and this program should calculate the sum of digits in this number.
So, for example, we will be given with a number with, say, Litz integer number with three digits.
And all that we have to do is to find what will be the sum of all of its digits.
So, for example, we have numbers five hundred and thirty one.
Then we know we can calculate it just by summing up five plus three plus one, which will give us a
total of nine.
OK, so simply taking, simply taking all of the digits, five, three one for example, the units,
the tenth and hundreds summing them up together and returning, basically printing the result to the
screen.
OK, nothing complicated actually of the main thing that you have to bear in mind is just how you're
getting any one of the digits.
OK, so there should be a rule that you should apply to get the units, which is one to get the 10th,
which is three and to get five, which is the hundreds.
OK, so the numbers just know that all the numbers that this program should support is just numbers
with three digits.
OK, basically we will not even add some testing, some condition to make sure that this number is actually
with three digits.
We will simply assume that the user will read our descriptive message and it he will treat this information
and he will insert he or she, of course, will insert a value with three digits.
So then we can work with it and sum up all the digits.
So give it a shot of your own if you have any questions so far before seeing the solution.
Also, feel free to ask them and let's get to work.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.