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, guys, so let's get down to business right away.
So we want to write a program that we'll find that we'll find the maximum and the minimum values between
two numbers.
All right.
So, for example, for example, let's make a quick example here.
If we have two numbers.
These numbers should be of a floating point type.
So, for example, the first number is three point five and the second number is 5.2, like you've seen
previously.
Then we want to print a message like this that we want to bring two messages.
Actually, the first one is maximum.
Maximum.
Equals two 5.2.
And the minimum minimum equals two three point five.
So these are these are the two messages that I want to see on the screen.
All right.
So let's go.
First of all, let's remove let's remove these comments and let's create we need to create two variables
of a floating point type.
So we just type float load.
Right.
Float number one and number two.
Then right after we've created them, we will read the values from the user and store them inside of
variables num one and two.
All right.
So print f enter number one, semicolon at the end.
And also we will print the same message for an arm to us or print f enter number two.
And now we are going to read, to read to see is their function scan F to read the value from the console
and storeyed inside of number one.
So for that we are going to use scan F percentage, not D but rather a percentage F because we are using
a floating point type.
And then we are going to specify the address of number one, the address of number one.
And we will do the same also for NUM two.
All right.
So now to scan F percentage F and store the value inside of the variable and two.
And now at this point, we have both of our variables holding two values and we can just print them
right away.
Right.
We cannot print maximum equals two now.
One and or minimum equals two.
Um, two, because we don't know what each variable holds.
Either we say higher or lower number.
So for this, we are going to use a condition that will check which variable number one or number two
holds the higher value.
So it goes like this.
If no one greater than NUM two, then we know for sure who is the maximum.
Between these two numbers and also we know who is the minimum.
Between these two.
Right.
Because either it's one of them is either either is higher than the other one or it's lower.
Basically, we are not taking here the case if both of them are equal.
All right.
We are just leaving it as living it aside for now.
So if that's the case, we are going to open a block of commands.
All right.
An associated block of commands that will be executed if the result of this condition happens to be
true.
So we are going to print two messages here.
The first one is print F and we are going to use maximum value equals two percentage.
F.
Make sure you don't specify here percentage D because we are using a floating point type.
And of course a backslash and at the end.
And we are going to specify here that instead of these percentage F, we are going to use num one because
it's greater than num to end.
It holds the maximum value.
And also we are going to write pretty much the same message.
Just to explain where the minimum is for it.
So minimal.
Equals two percentage.
F also backslash and but now instead of num one, we know that minimum will be in a will be stored in
the variable num two.
So the value is going to be story number two because number two is definitely less than NUM one.
So it will held the minimum value between these two numbers.
And now we should also specify the elf's section, what will happen if the result for this condition
happens to be false.
So here we go again.
We specify that a block of commands and we go to print out that the maximum right now, if this condition
is false, then definitely no one is at least equals to num in Vietnam to at least equals two num one,
or it may be higher than num one.
Then we will assume that maximum is number one.
So percentage f backslash n backslash.
And and if we specify the variable now two and we go the same way, let's copy and paste that, that
the minimum in the.
Case will be won and very know, we can say that we are done with this program.
And if the result of the condition.
Just to summarize it once again, if the result of the condition is false, meaning that no one, no
one was not higher than none to, then we would print we would print the maximum the maximum value of
NUM two and the minimum value of one.
Am just less things to mention here.
No, that's okay.
We talked about it.
So let's just build and run it.
So no one is going to be three point two and number two, he's going to be five point seven, let's
say.
So here we can see maximum equals to five point seven and minimum equals two three point two.
If we tried to do another example, let's say that we use now, one equals to ten point five.
And num two equals to nine point six.
Then we know that the expected maximum value is ten point five and the minimum is nine point six.
So let's see if that's the case.
Yes.
And our program actually finds out exactly what is the maximum and what is the minimum between these
two numbers.
So you've developed a quite a nice program here, and I hope you're proud of yourself.
You keep moving forward.
So that's it for these video guys.
And I'll see you in the next one.
Have a nice day.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.