Programming in New Nigerian Standard Language (C++ If / Else If)

Programming in New Nigerian Standard Language (C++  If / Else If)


Hello Everybody wai de hear me and welcome
to today lesson, today we goe do If/ Else if command
If/ Else if command na one of the command for c
programming wai we take de make decision and i goe
like make we use this question wai deigh our front
take explain am so first make we read the question. The question say write one c/c++ program wai
goe request 3 number from the user and the program
goe decide and display the biggest number for
screen. From this question we see the word decide
so that decide automatically we need our conditional command,
so make go make write our code and we goe use the normal
settings wai be make comeout these stringsdem. wai be hash
include iostream using namesapace std,int main return 0
so em, from our question, first we need three number so
em, our number goe be integer and for every integer
we need to store am for one particular variable so,
make we introduce our integer data type and make call
the first variable wai goe store our integer n1, the
second variable n2, the third varible n3 and since
we need another variable wai goe show us the biggest
number, make we call the next variable biggest. So this biggest, the job of the biggest na
after we done write our condition na to display, na
to hold and display the number wai big pas out of
the n1, n2 n3 wai we enter. So now make write our string with
cout new line, enter the first number for here, so
to enter the first number we need our blink blink
wai be cin so, the first number na n1, so we copy
this line we paste am for three different place and
make small changes ok so the second line we need
second number there and n2, the third line we need
the third number and n3. So em, we done enter our
string finish the next thing na decision but first
i want make we save this program, make we save am
and make check how ei goe be for screen before we
continue with our condition so we go to compile and
run am like this, we give am name, make we say big
so we save am, so em, if we run this program, ei
goe show us the screen wai hold those strings the
first string there na enter the first number, make
say for instance we enter 3, we come down, ei say
enter the second number and for instance if we
enter 7, ei come up again say make enter the third
number then we enter 9, so if we click am, ei goe
end for here because na where we stop be that now make give am condition so that, after
we enter those three number the condition goe let us
printout the biggest number among them so em, now for
the condition we goe say if n1 big pas n2 and
n1 big pas n3 nayin be sai the biggest number na
n1 so else if n2 big pas n1 and n2 big pas n3 nayin
be sai the biggest number na n2. now the last
condition say else if n3 big pas n1 and n3 big pas n2
nayin be sai the biggest na n3 so em, after we done
write this one then make we put our small string
for here wai goe display the biggest and for our string
make we say new line the biggest number na biggest,
the biggest number goe be this biggest because
nayin hold each of those number wai big pas for
every condition so na biggest, make try run this
program make see the outcome before we continue, we
go to compile and run so if error no deigh ei goe
em, come up rightly, so for here make we enter make
we say first number na 4, second number na 5 and
the third na 6, so out of these three numbers if we
click enter again the program suppose display the biggest
number so if we click enter we goe see am sai the
program write for here sai the biggest number na 6. Make run
am for the last time again with another number, so
we goe to compile and run, we run am then the string
say make enter the first number make we say 30, the
second number make we say 29 the third number make say
200, so according to the program the next string wai
goe pop up goe show us the biggest number out of these
three and if we enter am we goe see am sai na 200
be the biggest number so em, nayin be that for this
program for if and else if, we goe end this lesson for
here today and we goe continue for another video
so em, prople wai never subscribe wai never share
our video make una do am the right time and until
we see again for another video bye bye.

Leave a Reply

Your email address will not be published. Required fields are marked *