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, ladies and gentlemen, and in this exercise, what we are going to do is basically
to write a simple program, make some logic, OK, so we have a program and these programs should work
on an array and let's say we will have some array.
You will have some array of values.
And what do you have to do is to print, print, want print of some?
Of two elements.
In this array of two elements.
That is.
That is the most close.
Two zero.
So, for example, we have these array.
Let's see one, two, three four elements, we have one, we have minus two, we have two, we have
three.
OK, so we are looking for a pair of values that there are some will be closest to zero.
And what do you need to understand?
And that's basically what you need to solve is that let's say we have here is zero.
We have positive numbers, right?
We have here positive numbers, positive values and we also have negative values negative.
Right.
So what would you need to understand is where are you closer to zero?
So if we take one and minus two, we will get a sum of minus one.
If we take one and two, we will get a sum of three.
If we take one in three, we'll get a sum of four.
Then we can take minus two plus one.
We already know the result minus 2+2 will give us zero right minus two plus three will give us one.
So that's how you do it, and you can find out that there are a lot of pairs of sums that we can find
within an array.
OK, we need to take the sum of any two elements and find which of these sums that will be generated
from this array.
Sorry, will be the closest to zero.
OK, so which one of them and the way you compare between minus one and one, for example, you always
know, let's say that two is greater than minus one.
Or that basically you need a way to find out how you find the closeness to zero from both sides from
positive and negative.
And for that, you can use either some logic.
If a number is negative, let's multiplied by one to find out in comparison to where it stands for the
positive number.
Or you can simply use the ABS function for any value, and this function should return the absolute
value.
The absolute value for a given number that you are going to provided here.
OK.
So yeah, these are the instructions pretty much guiding you to solving this exercise.
So try it on your own, give it your best.
And once you're done, I'll see you in the solutions VIDEO.
Thank you so much.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.