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?
You're an Alphatech C programming chorus.
And in this video, we are going briefly to go over the implementation of our last example, where we
discussed how we are going to find the maximum between given two numbers.
So, first of all, as usual, we start with adding the includes, then add the end main section, your
entry point, create two variables, number one.
And number two, to hold the values read from the user.
Then we should print some guiding message for the user.
That will help him in understanding exactly what he should do.
And now we are going to read these two values, one off through the other two years to scan our functions.
When the first one reads the value for NUM one and the second scan of functions for SCANA function for
number two.
And now we use our condition.
If no one is greater than NUM two.
And if that's the case, we know that no one will hold the maximum.
Right.
That's why we should print its value.
So we simply use the print F and we just specify Max equals two percentage D and instead of percentage
D. We know that it will be replaced by the value of NUM one, which is in this case the maximum value.
Otherwise else we will print the value of NUM two because we know that definitely num one is not greater
than num two in this case.
And at the end of course, we will specify the return zero.
That simply tells that our program has been terminated successfully to the operating system.
All right.
So I hope this structure is clearer to you guys.
And now I want us to go over the flow of the code line by line, exactly as we've seen it previously,
to see the exact commands that are being executed for the two different examples.
So all the lines of code until the condition are nothing special.
We already know exactly how to do them and how to write them.
Nothing special here.
So let's just assume that no one in this case will be down and NUM two will be five.
OK.
Meaning that there will be two variables behind the scenes.
Number one.
And number two.
And number one will hold the value of ten and num two will hold the value of five.
And now let us use the condition and check if the value in variable on NUM one is actually greater than
two.
So if that's the case, we are going to execute this line of code.
And basically, once we've executed this command, we are going to skip the yellow part and just return
zero as we always do.
And we can actually say that that see it.
Your program found out.
What is the maximum.
Between these two values when the result of the condition was true.
All right.
Good job, guys.
I hope you keep up with the pace.
I tried to summarize this topic, but yet to give you a lot of details, a lot of information and to
go out with you line by line and show you actually how these conditions are actually executed.
Behind the scenes.
So I hope you're with me on that.
So just to summarize all of these execution, if we viewers to numbers five and seven, then these message
of marks equals to seven will be printed on the screen.
And now let's see the flow of the program with the value of NUM.
One is not greater than the value of number two.
So the steps are pretty much the same as previously.
Starting at the main reading, the values from the user, let's say that here the first value will be,
let's say three, which will be stored in NUM one and the second value will be five, which will be
stored in two.
So now the result of the condition.
If no one is greater than NUM two, we'll be false in such a case.
Right.
And if it's false, if it's false, that means we go through the yellow section right away.
We simply skip the previous print f right.
Because it relates thirith situation where and the condition was true.
So now we should simply execute these particular print F and just specify that Max equals two percentage
D and give the value of NUM two, because we know that currently number one is not greater than NUM
two.
That's why we came here to the yellow section.
And there you go.
You can try running this code on your own.
Use a couple of example.
Use a couple of different values.
Just play with it a little.
Make sure.
That everything works just as you've expected it to work.
And also tried to check and understand what will happen, what part of the code will run, and basically
why, if the user uses two numbers, which are the same.
For example, five and five.
So, as always, thank you guys for watching.
And I'll see you in the next video.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.