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
All right, welcome back to another amazing video in our programming course.
Any of these video, what we are going to do is to write an efficient program that receives a number
from the user.
OK, so so far there will be nothing efficient regarding the program, but the efficient path should
come next.
OK, so what the program basically should do, the program should calculate and print the sum of all
the numbers from one up to these, given the number that we receive from the user and we should include
in these some only the numbers that can be divided by three and also can be divided by five.
So let's say that if we take a look, for example, at Naameh, we're now equals to, I don't know,
a hundred.
OK, just just just as an example, then we know that all the numbers from one up to a hundred will
go like this.
So one, two, three, four, five, six.
Right.
So on and so forth on basically up to a hundred.
So what you have to do is to create the sum, probably a variable.
And these sum will contain is part of it.
Just the numbers that can be divided both by three and by five.
So in this case, in this sequence, if we take the value of three, what do you think?
Will it be part of the sum or not?
And also, what about five?
Will it be part of the somewhere or not?
So basically we can say that while three may be divided by three without a remainder, it is definitely
not divisible by five.
And also five can be divided by five, but not by three.
So also, if we have nine, nine can be divided by three, but not by five.
So that's why we don't make it into some.
But one number that we will take is 15, for example, because 15 can be divided both by three, which
will leave us five in both and also by five, which will give us three.
So there are a couple of numbers, a couple of values in these like sequence that may be that can be
actually divided by both three and five.
And what we want to do is to take these numbers, to sum them up and to print the final some of these
numbers from one up to give a given number.
And what do you have to do is, first of all, think of, let's say, the trivial solution with the
basic solution that you would think about just using probably some loop to iterate over all the numbers
and testing out a couple of conditions.
And then you will have to optimize these programming to be efficient, more efficient, at least than
your previous solution, where you checked about two conditions.
So take your time.
Think about the solution, because it's important to come up with two options.
The first option is less optimal in the next one will be more optimized.
And yeah.
So my name is one.
This is Alphatech.
This is our amazing programming course.
And good luck, guys.
LCN in the next video.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.