guys just have a look so in the code so uh look what we need to do so there is five three so it needs to have five and three here so what i did i said i have a function that prints that prints n times b so i say uh n is three and i call the function print b n times so print b of three it will print b b b okay i have a function that prints blank n times so i call function blank uh print blank 10 so it will print me 10
blanks okay is it clear yeah yeah i have a function print b and times print blank n times okay why do i need these functions when i when i i made a function uh print first row so in the first row i print a then if it's necessary i print b and times and if it's necessary i print c so only a is necessary so we go a then b then b b b b b and at the end c if there is one it's only a if there is two then it's a b if
there is three it's abc if it's four it's a b b c okay so function prints print first row i have a function print middle row in the middle row we have b then n times blank and b okay and i have a function print last row so it's c n times b and a so basically i use three functions print first row print middle row and print last row oh exactly okay in the function in these functions i use print b end times print blank n times okay yeah okay so let's see the code
now okay so the here yeah you you will submit this file so i will submit everything you will take it delete and then submit this we'll do it together okay yeah so if you here this is important for z for c zero zero function right okay yeah so function right does has three arguments so this is function right it's already done here it can be zero one or two all right i think it's you need to put something it's input if it's one it means that it will write something oh it will write an output
and if it's two it will uh uh it will uh uh have error message so always when we want to print something we put right one this second argument is you uh so we have some character c okay two characters so it can be d or m or or s okay so it's all character and we say this character c we give it value m okay so then it will write c has value of m and it will write them you need to call it with this with n c okay or you call it with
a string you will you will see it okay okay this is important and the third argument is how many uh uh length the length of this so if we print only one number or one letter it has uh it has length one okay this is important to understand this right function so this right function it needs this library include uni std.h okay and with this write function we wrote a new function the new function is ft put char because they call tell us you need to put ftp char main and rush zero four okay so
yes ft put char is adjusted variable or function ftp is is a new function is the new function function so we call it it's called new function so what does this void mean void ft put char it means that this function will not return any value it can write something but it will not return to you value you cannot say uh uh x is equal ft put char of true okay because ft put char only only writes something it doesn't provide you uh doesn't give you back the value okay so void means nothing so ft
put sure doesn't return any value okay and write means printing what right there yeah right it will it will only print it will only print something but it will not uh give back any any value so when you something it's one process when you return some value it's another process okay so void ftp char means that the function put char will not return nothing okay okay and what do we need to give to this put share function we need to give it some character c so char c means character c okay so this function ftp
that doesn't bring any arguments back that for the input has one character c what does it do it just writes this character c in the terminal and that's it okay yeah that's it so this is function ft put charge and it's important that you understand this right function okay okay now we have the rush function okay the rush function i i used i told you so we need to include unisd okay so here we need to use this function ft put chart we defined it already here okay this is the function ftp chart so in
the rush in the rush file in the rush file we just say okay we will use function ft put char okay what does it mean you will see later on that i called this function ft put char so it it will give me something okay then i had to create additional functions so we spoke about this print character end times okay so print character n times is this so either i print b for the three times either i print blank for the end times okay you see here i print b for the one two three
one two three times okay or i can print blank three times for example okay so this function prints characters end times it will print a character that you give it so it will it will print either b or blank whatever character you give it and it will print it n n times okay so if i give to this if i call this function print character n times and then i say five dot m it will write m five times say hey please if when i call this function print character n times and i call it
five instead of nm i write five and instead of character bp i say d is the here it will it will print fi d d d d d d phi times d okay if in another line i call this function print characters and times three and put s asante what what will this function do print s five times yes correct the hero view if i put print char n times uh two and i have here the blank what it will do planck three times blank two times two times four two times because i put n2
here for example okay is it clear what does it do okay so now i say how do i do this while this number for example will take uh three and uh and s so three s we need to write so n n is three and this bb is s okay so we need to have sss so we say while so three is greater than zero okay then put function put char what does function put char to print right it's right it prints the character right so so three is greater than zero so we have here
three and here we have s so n n is three three is greater than zero then print ft put char this what is bb it it is s so it will write one s okay and n minus minus it means that this three will not be three to b two so 2 is greater than 0 yes print additional s so we have the second s then we have mine uh they have uh minus so it's not two it's one okay one is greater than zero print s so we have sss and this is zero zero
is not greater than zero exit okay so this function prints this function prints no it will print three three s because we put here three s so sss if we put here the blank it will do the same two and here is the blank so two is greater than zero blank it becomes one one is greater than zero margin blank zero zero is not greater than zero do you think that for i'm sorry do you think that for the video you can you can select uh the the places where you face everything yeah so now
once again we print print character and times so how many times we put it here so for example two times okay and here we put character m as for marco so we have two and we have a character so what is the value of n it's two okay so is two greater than zero yes yes yes so then this function ftp chart prints this bb what is the value of the character bb yes no we said n now so it will print m yeah it will print one so i will put m okay m okay
so n n minus minus so it means n is 2 and minus minus what will n have value now one one yeah so what is value of nn one is great is n n greater than zero is one greater than zero yes okay so it will print another s not s m m no problem okay and then n n is one and n n minus minus which is zero bigger than zero no no so it will not do anything and it will just exit so we will just have printed m m right and sorry it
means you have to put here how many times and here jar and for example d or yeah you can put okay instead of nn you can put any integer so you can put five you can put uh a hundred instead of instead of uh bb you can put any number that you want you will i mean when you use e f g h i whatever you want when you tell when you wanna test it yes okay thank you yeah when you when you want to test it you call this function and you call it we'll
see later on how we call it okay okay you just put here print char n times 5 comma a so it will print q five eighths exactly okay is this clear now yes this okay so we have a function f t put chart and this fringe jar end times it just prints character that you want how many times you want it okay okay okay so now we will print middle okay we'll print middle row so what do we have in the middle row in the middle row it's p b b b blanks b right okay
okay so when we want to print only one middle row we always start with a b right is it correct yeah so we have b then maybe we have some blanks and then we have another b okay okay so we start we start we start with a b okay so we need to know how what is the length of this just so we need to know what is the length of this here we have five characters so it's b zero zero zero b right yeah okay okay okay so we need to give to this this
function this function print middle row we need to give it what is the what is the length of this middle row right so here it's five here middle row has only one character here here middle row has one two three four four one four here yep okay so for the middle row for the middle row okay yeah for the middle row we need yeah first thing we print b okay because it's always you see it's always b we start with a b okay then we print blank i don't know n times and then we put
b okay yes okay so here we have following so we need to give it what is the length so for example five so if it's five it will be b blank blank blank b okay where you want to give them and if we print middle row yeah with five yeah so the middle row will be b playing blank blank and b right so look at look look at this this is this is the middle row okay this is the middle row which one so this is the middle row what is the length of this middle
row five it has it has five characters right yeah so in my function i need to give it how many characters i want okay will you regret then what where are you going to give that and yeah i need to yeah i need to give it this number how many characters i want i want you to print so based on this length it will do this so first thing it's uh it prints it prints character b because it always starts with a b okay it always starts with a b there then if if this length
is two okay then just print additional b okay it will be bb as you prefer i can guys we we just need to uh to agree on how will we do this for example if we have if we have length 2 i put if it's length 2 i put bb maybe we can put b blank because it's not behind if it's three is b blank b but if it's true i put it should be b b maybe we can put b blank as you wish but they said if it's uh if it's length two it
will be bb we can put b blank but i put it b so if it's one it's b if it's true it's b b if it's three it's b blank blank b if it's four it's b playing blank b if it's five it's b then three blanks and b is it clear yeah yeah yeah okay so we have length five so we we first put b okay we need to ask is this length two if if it's the length two you just uh prints additional b and that's it we just have bb it's not the
case if length is greater than three okay if it's like this then we already printed b then we will print character n times character is blank and how many times length minus two so in our case if we have five so we will print two i minus two is three times blank yeah perfect three times blank and b okay correct okay and then at the end we just need to put the last b is it clear 100 okay and at the end we just press the new line so basically b b b blank b and
then go to new line and that's it okay and and can you go look uh here look at my look at my terminal so it's b blank plane plane b and then new line okay yeah yeah yeah 100 can you put the new line and end of the function is here and after can you bring and put the and and under the ft butcher p i don't understand the question can you please repeat yeah do you know the new line do you have to bring outside the function or you can do it all also no
we need to bring it outside the function because when everything is done we need to to print it guys you're just here we just need to to agree how do we do this i put if the if the length is true it's bb okay maybe it should be be nothing as you wish maybe i will put b nothing later on okay but i think also this is okay because here they didn't go through this uh through this when we have uh only length two how it is because when we run this with with these commands
we get exactly the same okay okay okay guys so is uh is this function print middle rows okay yes so print middle row will just print one row of uh of uh b okay only one time is it clear yes very clear okay okay function print first row so it basically prints the first row okay so it's a then n minus two times b and at the end it has c right yeah okay so first row it always starts with an a okay for this function first row we need to say how many characters there
are okay so how many characters there are in the first row here five five here one one how many characters in the first row are here four four okay so we need to give this number to the function so it it needs to know how many times how many characters are there in the first row so we say void first print row print first row okay and we need to give it some number so integer length b okay okay so the first the first the the first number always starts with a it always starts with
a okay then it prints b it prints a b uh uh several times at the end print c okay so first write a okay okay if if length is two okay then just write b and that's it okay but if length but if length is greater than three or equal three so it should be if it's three it will be a b c if it's four it will be a b b c right if flint is greater or equal than three what do we do we already have we printed a we need to print b
length minus two times so five minus minus two three times okay and at the end print character c okay we will not print c if we only have one character okay if length of b is one so what do we need oh what shall what will what will we print so it's here it's here it's here if lan if length is one we should have printed only eight right yeah if length is two what should be printed a p a b if uh uh if plant is three what should be printed abc yeah if length
is four what should be printed abbc yeah correct so if a is one if a is one print a so print a uh 1 is not equal 2 so it will not do this 1 is not so length of b is 1 so it will print a yes and yeah so length of b is one one is not equal to so it will not do this okay one is not greater or equal than three so it will not it will not do this okay and it will just put a new line so we'll just have
a a new line okay okay if it is if len if lent is two okay so a print a and then b length is two so two is equal to okay so print b apd a b then is two greater or equal than three no no it doesn't do new line okay if it is three three so print a yes no it's no so it doesn't go here okay is it this yes so print three minus two is one print one times b and then print c is ft put your a okay five this is
not true right so it will not print b okay so five is greater or equal than three this is correct right yes so print charge n times so print five minus three times b perfect okay and then so this is print first row it the it's is basically the same the same that the c and the a are inverse yeah but we just have additional additional condition so print c if length is two only print b so this is the last row so which one this is the last row oh all right yeah so it's
c then b b b b and then a okay just let me okay okay guys so so it definitely prints the c maybe it will not print b but if event is two it will print b okay if lent is is three it will be c b a if len is four what will it be c b b a no no no no so we put c then we put b's and then at the end a all right okay so basically the same thing we print c is length two if length is two then just
print b okay if length is greater or equal than three we have c print b n minus two times and at the end print a and that's it is it clear yeah yeah okay same as the yeah but it also has a twist so for example here in this rush by one we only have first row right we don't have the second row and we don't have the third row we don't have the middle row and we don't have the the third row so this third row it will be written only only only if uh
only if if this is greater or equal than three so we have first row then maybe we have a middle uh middle row and only if this length is if this depth is greater than three we'll have the row number three for example here this is one we only have the first row okay this is five so we have first row we have three times middle row and we have one time the last row okay when this is four we have first row we have two times second row and we have a one time the
last row so if if this is uh bigger than or equal than three only then we will print the last row okay is it clear yeah it means if i ask you a question yes the code that you write it has to satisfy one two three four five uh [Music] pictures the code that i wrote has to satisfy and what yeah you don't see it you see it uh has to first satisfy when i write five when i write five three it needs to to give me exactly this when i write five one it needs
to be exactly this when i write one one it needs to be exactly this okay when i write one five it needs to be exactly this four four exactly this okay all right okay yes okay with this sprint last row we need to give it number of uh how the length the length is this one two three four five but we also need to give him this three one two three because if this is less than three it will not print the last row okay okay okay so let me just go quick so with this
if this last row has two parameters so what will be the length of the length and this depth so if depth is three or bigger than three then do what what we spoke about okay if depth is uh uh lower than three then it will print nothing okay okay so the last row will be printed only if we have three or more rows needed okay then after we have to uh we have to then take it more than minimum three isn't it yeah minimum three so for example here you see you don't have the last
row you don't have the middle row you only have the first row okay here you don't you only have the first row okay and this is also the last one is that one two four is it is it okay guys what's the role of last one i don't see a and very well sorry please repeat that here go back yeah the last four four yeah is that uh then we will get the last row we will have one time first row two times middle row and one time and one time third row it means a
first and two b and one c yeah okay is it okay yeah yeah then we have to keep that will be three or four yeah okay so now the rush okay so first we say in the rush function we will use these three functions print first row print middle row and print third row okay print last row so first if a