 Assalamu alaikum. This is Introduction to Programming and today is lecture number 6. Let again, as usual, let's start with a recap of what we have done in the last lecture. Last time, we looked at the conditional constructs of C language, IF and IF ELSE. There is another conditional construct, but we will cover it in the following lectures. With IF, our programs have begun to become a little intelligent. Now, we can make some decisions. There is another very important construct that we will discuss today, which we will discuss today. That is loop, that is, repetition structures. Many times in our daily life, we have to repeat many things. Let's take a simple, trivial example. We say that every morning and evening, and so on, if you look at a month, you have repeated the same cycle 30 times, if there are 30 days in that month. So, repetition structures occur all the time. If we say that we have to process a payroll of a factory, then payroll is something that we have to calculate from the first person to the last person. Usually, these calculations are of the same type, so we have to repeat them again and again. So, again, a repetition structure. To introduce these repetition structures, let's do some exercises. Let's do some interesting mental exercises. Let's suppose that I give you a problem. Right now, we are talking about integers. I give you a problem that I write a program, in which you print the sum of the first 10 integers from one to ten. So, you can do this program with the tools you have. And the simple approach would be something like, either you say, int sum, and the next line says, sum is equal to 1 plus 2 plus 3 plus 4 plus 5 and so on, plus 10 semicolon, cout, less than, less than sum. So, the program is written, but it doesn't go so easily. I say, it's written, it's gone, there is no syntax error, you have seen the output. So, now you know what the sum of the first 10 integers starting from one is. So, let's do another problem. And the next problem is, find me the sum of the first 100 integers starting from one. So, what will you do? Okay? I say, very, very good. You have now obtained the sum of the first 100 integers. So, please go and now get me the sum of the first 1000. Do you see where we are going? Bad practice, the way to look at this problem is as follows. I say, we know the integer. We haven't defined the problem. We have to sum it from one to 1000. If you have integer number one, do you have any way of finding out what the next integer is? I'm sure you have. You've done it in calculus. It is the previous integer plus one. A generic statement is given that if you're given one, what is the next integer? It is one plus one. Answer two. If you're given two, what is the next integer? It's two plus one. Every time to get the next integer, you gather one in the previous integer. So, if you look at our original problem, find the sum of the first 1000 integers starting from one, how to approach it. We will do this for its analysis. First, we take a variable. Do you remember the concept of the variable? Balty. So, there's a bucket line over there. The sum is written on it. And the balty is empty right now, which means we will declare a variable of type integer int sum. We will initialize that. Again, good programming practice. First, make sure the bucket is empty or it contains what we want it to contain. Because we haven't started the work yet. We say that the sum is zero in the balty. So, it says sum is equal to zero. Now, what do we have to do? The analysis is going on. So, we say, first, pick up the first integer. That, by definition, for our problem is one. You put that in the bucket. Then you find the next integer, which is the previous integer, in this case one. Add one to it. That gives us two. Now, put this in the bucket in a way that it adds to the previous value. You find the next integer plus one. Put it in the bucket in such a way that it adds to the next value and so on. So, see what we're doing is that in the talks, this thing has been cleared that one thing we are repeatedly repeating. So, we should have some programming construct, through which we can do this repetition easily. In C, there are many programming constructs with which we call looping. We call it loop. We can do looping. For that, we will start with one construct today. That is, while statement. While is the word in English, w-h-i-l-e. Here, let me just pause and reiterate. See, whenever I tell you a word for C, in the last lecture, I talked about if and else. Today, we are talking about while. These are the keywords for C. You cannot use these keywords as variable names. So, let's start with while today. What do we do in the while construct? While means, j-b-t-k. As long as a condition is true, keep doing it. These things will be statements. Just like we talked about if, you can also use braces with while, curly brackets, or let them stay. When will you let them stay? If you only need a single statement because of while, then you don't need braces. But again, repeating myself, for good programming practice, just try to make sure that whenever you write while, after the condition, you open the braces. Then you have to write one statement or a thousand. You can write that and indent it. Because this block is coming in the braces and then you have to close the braces. This will not have unwanted side effects or logical errors. So, while loop is the first one that we worry about. It's a very interesting construct. It's a very elegant construct. And its basic syntax is like this. As long as this condition is true, keep doing this. So, in C, the syntax is while. Here, parentheses or parentheses can get a logical expression. That logical expression obviously will contain a logical or a relational operator. And while means that as long as this relational expression is true, it keeps giving an answer. As long as this expression is true, the rest of the statements will continue to be executed. Now, let's go back to our addition problem and see if we can do it in a nice, simple, elegant manner. Now, what was our problem? Let me reiterate. It said, find the sum of the first 1,000 integers starting from 1. So, in terms of C programming. Now, I am not talking about the IOS stream. I am not talking about the main key. I am talking about the body of the program. First, we declare a variable in which the sum will go. Let's name it as sumricks. Again, programming is self-explanatory. It explains itself. If you are reading the program, you will know what will come in this variable. So, we say int sum, semicolon. Again, good programming practice. When you declare a variable, please initialize it. So, we say sum equals 0, semicolon. So, we made sure that we have got a bucket in which we will keep an answer. And that bucket is empty right now. For this, there is a shorthand in C. When you declare any variable, you can initialize it on the same line. It is a matter of style. So, you could have said int sum equals 0, semicolon. And that statement would have done two things. It would have declared a variable called sum of type integer. And it would have initialized it to 0. Which means now we have written one statement instead of two statements. It is completely optional. You can adopt any style for yourself. Personally, I write int sum, and sum equals to 0. I write that initialization or the value assigned to it is seen on a single line. So, we have initialized it up to here. Can we now collect the number in it? Well, first, we need a variable for a number. So, where we wrote int sum, we also write comma with it. So now we have int sum comma number, semicolon. What will happen? The number is the variable in which we will keep integers. At this time, what integer is being worked with? So, the first few lines of the code will be complete. Int sum comma number, semicolon. Then we initialized sum. We said sum equals 0, semicolon. After that, we said take the first number. We said integers. So, take the first integer. And going back to the problem statement, we wrote that the first integer will be 1. So, we said number equals 1, semicolon. I'll keep repeating things. These are both assignment statements. What did they do? They did the calculations, the memory locations, which we labeled 1 as sum and 1 as number. We kept 0 in the sum, and we kept 1 in the number location. Remember, this is assignment, not any quality. Now, let's move on. Now, what is our problem? The problem is that we got a place, the number was also given, now start collecting them. How far do we have to collect them? This is the condition of the while statement. We said that we need a thousand numbers first. We need to take 1 to 1,000 integers. So, our ending condition is 1,000. When the value of the number becomes 1,000, we will stop at that time. So, what do we do? What we do is, we say initialized over, number is equal to 1. So, we say while parentheses open, number is less than or equal to 1,000. Parenthesis is closed. Relational operator, last time we talked, less than equal to sign, will be written together. There is no space between them. This means less than or equal to. So, now what condition have we made? We said that the number of the variable is less than or equal to 1,000. This is the condition, so this is the half statement. Now, what will happen next? What do we do until this? So, we say while parentheses, number less than or equal to 1,000, parentheses closed, braces open. Now, I am putting it in the bracket, again a stylistic issue. How will we get the sum in it? So, what do we have to do now? First, we have to analyze, think a little about the action. The action is, the current value of our number, pick it up and put it in the sum bracket. After that, what should we do? Generate the next number. So, the first line is very simple. Sum is equal to sum plus number. Why did I write this way? Why did I not write sum equal to number? Simple reason. If we had written sum equal to number, then it would have been an assignment statement. And the sum bracket would have been replaced by the value of number. We do not want to replace it by number. What we want to do is, add the number to the original contents. So, what we have used is, sum is equal to sum plus number, which means, first, take the original contents of sum, add the number to it, and store the result in the sum again. I was just repeating the good old statement that I had told you in the first or second lecture, that it is so common, x equal to x plus 1. We are using the same variant here. Sum is equal to sum plus number. Next, what do we have to do? Generate the next number. So, given any integer, what is the next integer? It is integer plus 1. So, we put in the next statement, number equals number plus 1. After that, we close the brace, and the wild structure is over. Just think about it. It is so elegant. You have neither typed the number 10, nor typed the number 100, nor typed the number 1000. We have put a small wild loop. We have put the three lines of the four lines. While number is less than equal to 1000, sum is equal to sum plus number, number equal to number plus 1. This loop will work. What is happening? The value of the number is increasing in every loop. 1, then 2, then 3, then 4, and so on. The condition that is applied to the top of the wild, it says, while number is less than equal to 1000, this is going on. When number 1000 happened, then this condition is still true. You will enter the loop. You will say, sum is equal to sum plus number. The last number is here. 1000 will be added to it. The next line says, number is equal to number plus 1. So, the value of the number will be 1001. Now, when the wild loop will test it again, it will say, while number is less than equal to 1000, so the answer to this will be false. When this is false, the loop is over. So, now your control of the program, it will not execute the statements written in the wild, it will go ahead with the end brace. There, we can put in the simple line saying, see out less than quotation marks, again to be self-explanatory and be polite. The sum of the first 1000 integers starting from 1 is, put all these things in quotation marks, then less than less than sign and then sum, semicolon. So, see out that you remember the property, it knows how to handle character strings, it knows how to handle integers. So, it wrote a character string, after that, the value of sum was printed on the screen, your problem was solved. Now, look at this, a little on this program, a little on this program, and let's see if there is any improvement in this or not. First thing, now if I come back to the same frame of mind, that I have to trouble the students today, I say that I have taken the sum of 1000, so now you go and take the sum of 20,000 first integers starting from 1. What will you do? When I talked about this for the first time, it was about heart attack, that after 10 numbers you have to type 100, then you have to type 1000, then we put the loop, life became very easy. Now, what is it? You open the program, where we have written 1000, whatever the near target value is, let's say 2000, if you do 2000 there, then the loop you have, while, number less than equal to 2000, and first the sum of 2000 integers will give you the program, 3000, 4000, 5000, you may be wanting to try it out, you try it out for yourself, in fact it might be interesting to find out that how far can you take the sum? If you say that first the sum of 100,000 integers, then what is the right answer? There is no correct answer. Let's see how far you can reach, take it to the discussion board, talk about it. The limit I am talking about will give you a hint, that we are working with integer variables, for integer variables, there is a special place reserved for a specific size in memory, if the number becomes so big that it does not fit in that place, then there is an overflow condition, now there will be two things, either your program will give you an error while walking, it will not give you an error on compile time, because it does not know what value will be given in that place, we are talking about the sum of variables, the number is correct, excuse me, after that, if we talk about the overflow, then either there is a run time error, or there will be some other value written there, how will the value be written, the value that the computer wants to write in the memory location, the extra bits that do not come in that place, will disappear somewhere, they will go into space, therefore the answer that is now written in some variable, that is not the answer to the question, this is some other number, so you might want to play with it and discover the limits of your computer, and your compiler, how many numbers are there that we can take the sum, let's go on with the same problem, and see how we develop it further, see when I said that the 1,000 problem has been solved, now take it to 2,000, take it to 5,000, what were you doing every time, you were doing that you opened the program in your editor, remember editor, you have to open the program in your integrated development environment, and there you did some modification, then you compiled the program, and prayed that while modifying, there should be no syntax error, that there should be no extra comma, and then you executed it, then you took the answer, I came and gave you another target, then you edited the program, so now you are in this loop, edit, compile, execute, change, meaning edit again, compile, execute, so can you do something better, now I am going towards reusability, can you write the program, where I come and tell you, if you give me the sum of integers, then without changing the program, you can tell me the sum of integers, think what approach will be, approach is quite simple, and I am sure that many of you would already have thought of it, suppose in the wild statement we have written, number less than equal to 1000, we change that, we say wild number is less than or equal to upper limit, so where did this upper limit come from, you declare a variable, then tell the user that while running the program, you should tell them how many numbers you need, so again good practice, good style, thinking of reuse, what would we do, we had already put two variables, sum and number, we put one more variable together, so int sum, number, upper limit, semicolon, now initialize sum and number to 0 and 1 respectively, and then tell the user what is the upper limit, now its interesting side effects will come, you said see out, let's give the user a prompt, please enter the upper limit for which you want the sum, and after that with see in, greater than greater than upper limit, semicolon, the number type the user, I will do it 1, 2, 3, 4, now the program will interpret it, first 1,234 integers need to be summed, after doing this when you will come to the while, so now the upper limit value has come, you said while number less than or equal to upper limit, that same thing sum equal to sum plus number, number is equal to number plus 1, now this program, at least till the time to gather integers, has become generic, from this we have done enough, this program did not take any more time, but see, now if I go to the upper limit when the program asks me, while walking, there I will put 0, then what will happen, if the upper limit value is 0, then when you will come to the while statement, there it will be written while number is less than or equal to 0, and the number at that time for the first time, what was its value, above you have written number equals 1, and then you have come to the while and said, while number is less than or equal to 0, is this condition true, answer is obvious, condition is false, if the condition is false, the loop will not run, not even one time, so while statement will fail for the first time, will come down, and your written will come down, the sum of the first, here also put the upper limit, in the output statement, so you would say see out less than quotation marks, the sum of the first, space leave the end quotation marks, then less than upper limit, then continue the statement, less than less than, then open quotation marks, then leave space, and the integers is, space leave the end quotation marks, less than less than, sum, semicolon, here when this program will run, and you put the upper limit 0, then written will come, the sum of the first, 0 integers is 0, very correct, so it is interesting that, there is a boundary condition, an abnormal condition, that the sum of the first 0 numbers, so the sum of the first 0 numbers, should be 0, its answer is correct, so you can see that just by playing with one simple program, you can get it to become more and more and more interesting, how about if we make it even more interesting, let us take the same problem, but in its statement, let us change a small change, I tell you that, that the first n integers, 1000 let us say, starting from 1, the even integers in it, I need to explain, now see, we are doing 2-3 things, one is, as I said earlier, you should think loop, loop will go here, but I have also qualified it, that I need even integer, so when even integer is required, then this is a condition, so now as soon as you think, or hear the word condition, you should start thinking if, so what will we do to do for this, our program becomes a little more modified, we let the first part be the same, upper limit one, the wild statement will also be the same, but in the wild, we are saying, what do we need to connect, if the current number is even, then connect it in front, otherwise don't connect, in other words do nothing, so it's a simple if, it doesn't have an else, in the wild it will come, if, and then in the bracket we need the condition, that condition is, if number is even, this is what I said in English, the question is, how do we write it in C, number is even, what do you think, now you have some arithmetic operators, you had seen, plus, minus, multiplied, divide, modulo, if any of them has such an operator, through which we can know, if an integer is even or not, if it's not even then it will be odd, remember, think about it, if we use mod operator, the percentage sign we used, and we say, number, modulo, two, what is the test of even number, that it is divided exactly from two, so, if we say number modulo two, and its answer is zero, so that means the number is even, now formulate the C statement, how it will be written, this test we said, if number is even, so the way we write it is, if, parentheses, number, percentage, two, equal, equal, zero, parentheses is closed, again I am recapping, that when we have to test equality, so single equal to, no, that is assignment, double equal to sign is used, so we say if, number, modulo two, equals, equals zero, parentheses is closed, and then the same style issue, put the brace, however the statement is the same, curly bracket open, indentation by one unit, and there we will write, sum equals sum plus number, next line brace is closed, now what is happening, this we have written in the if statement, in the while statement, there is no need, in the while it can be if, in the while it can be another while, it becomes nested while loop, now let's see our program, simple, initialized, sum is zero, number is one, we got the upper limit from the user, let's say he put 1234, now we are in the while, in the while it is written, while number is less than or equal to, upper limit, while goes in, there we tested first, the number which we are handling, is even or odd, we said if, number, percentage two, i.e. number, mod two, equals zero, with braces we gave the if statement, sum is equal to sum plus number, if statement is over, and after that we said, number is equal to number plus one, here we have to increase the number, regardless of whether it is even or odd, so first one will be odd, sum will not be added, number equal to number plus one will go, one will be two, return to loop, sum will be two, because number, percentage two will be zero, and the loop runs, and now when it will come out, so obviously you should change the C out, you should say, the sum of all even integers, between one and upper limit, which is its value is, and then next sum, obviously that is an exercise for you, but you already have this program in your handouts, so you should be able to see, the syntax of the C out statement, what is being made, so interesting we have found, how to determine even numbers, let us exercise a little, what if the percentage operator in the C is not there, all other things are present, all other rules are the same, but the modulo operator is not there, can you think of a trick, in which you can determine even numbers, think about it, I can tell you the answer, but give it a serious thought, how would you do that, look much earlier on, some lectures we talked about, one thing is integer division, and at that time I told you, the integer division truncates the answer, meaning 5 slash 2, when it is executed in C, as an integer division, its answer will be 2, answer will also be an integer, fractional part will be thrown away truncated, so we have got, 5 slash 2 is equal to 2, now how are we doing the test for even numbers, this is a programming trick, so I am telling you that, the more tricks you have in your good old tool bag, the more equip you will be to handle more complex problems, we did that, we took a number, and the number is an integer, we divided it from 2, integer division, whatever the answer is, we multiplied it from 2, again integer multiplication, so what will be the answer, so we have got 2 star parenthesis, number slash 2 parenthesis is closed, what is the result, see what will happen, if the number is even, then the division will be number divided by 2, it will give the exact answer, it will give an accurate answer, you will multiply it from 2, then you will get the original number again, if the value of the number is not even, then the integer division by 2, the answer will be truncated, and you will get the next lower integer as an answer, when you multiply it from 2, then you will not get the original number, so you can think of formulating another test, for finding whether a number is even or not, without using the modular operator, this was an aside just to add a little trick to your toolkit, because who knows, when you become a proficient programmer, what language are you working in, it is possible that the mod operator is not in that language, and if it is not, then what does it mean, we can not even determine the numbers, we can, keep that in mind, now look at the loops, what happened, we have seen 2-3 small programs, the first thing I will tell you, we got a very clean and efficient and elegant way of programming, a long program in which we had to do 1 plus 2 or whatever, in a small concise language, abbreviated and programmed in 3 lines, it works, and what are those 3-4 lines doing, calculations of thousands, how many times do you want to make a loop, you determine, the loops that we have placed, they are going to the upper limit, until this happens, keep doing this, and normally, the loop like this, the test of that, changes the condition of the body of the loop, in this case, we were testing the value of the number on the top, and the value of the number in the loop changes, this is almost necessary, in the structure, when you change the value of it, then it changes the condition of the original while, otherwise, there can be a problem too, let's take a simple example, if we talk about, we put another variable on the top, and give another name of the variable, it is called junk, it is also an inch junk, and you called junk, junk is equal to 1, we write loop while junk is less than or equal to upper limit, and we don't do anything in the loop, we say sum is equal to sum plus number, number is equal to number plus 1, what will happen, it will be a bad thing, this is what is called an infinite loop, we are not changing the junk, the condition of the while will always be true, the computer will be going crazy, until there is no overflow condition, or there is no electricity, or there is no smoke coming out of the computer, it will keep going, your program will be stuck for infinity, watch out for that, make sure that when you are putting any loop test, in this case number less than or equal to upper limit, that loop test keeps an adequate exit, some condition is changing, in which it gets an exit point, be very careful with that, we don't want infinite loops, while loop gives us a way to handle complex problems, combine it with an if statement, like we just did, you can do many examples for yourself, for example, I will pose you, now you take odd numbers, between 1 and let's say 1000, or whatever number is keyed in at the keyboard, take out the odd numbers in between, you take them out separately, even numbers are this, odd numbers are this, and use only one loop, think what we will do, hint, if, else, you have either an even number or odd number, if we are talking about integers, you can use that too, there are many things, so here we will introduce you to the loop flow chart, its structure is a little different, you will have to understand it a little, but it is not difficult, it is simple, see what is the first thing in while loop, condition, for condition we have a diamond symbol, with condition you have to put an exit, or how to get out of the while loop, and later the body of the while loop comes, what is the statement, so let's look at this construct, that you entered from above, made a rectangle, in which you wrote while, and from the right hand side of the rectangle, you took out the line, and on top of that you made a diamond, and in the diamond, you wrote the condition of the while, now you will make the line from the diamond, if the condition is true then what will happen, that is, what will happen if the while loop goes, below you make a rectangle, make one, make five, those are the processes that will go inside the loop, the line coming from below these rectangles, you bring it up, as if you have given it in the diagram, and it becomes a loop structure, and the rectangle of the while, we took out the line from below, and it became the exit of the while, that is, the closing brace will be here, so if you see the structure of the while, then from the top to the bottom, there is a straight line in between, there is a rectangle in which the while is written, so the rest of the things will be visible to the right, this is the thing that we were using in the code, that when we wrote the while loop, we indented the body of it, so again this flow charting construct, this also helps us with the code, in one to one correspondence, now we are doing the opposite, we write the code first, then we tell it what is the flow chart, that is, we are introducing these things now, later when the problems will get more complex, then normally in their analysis, you will first make the flow chart, and then you will write the code, so keep these constructs with you, keep them in your tool bag, then we put an if statement in the while, if we look at the same construct, that the line from the dimension of the while, where we are making processes, you will put an if statement there, remember that I told you about the if statement, that you put a point at the top and bottom, and whatever the if construct is made with a point, there are the starting and ending points of the if statement, it is very simple, wherever there is a rectangle in the body of the while, you remove the rectangle and connect those points there, so what you will see in the picture, the picture is the flow chart, if the while loop starts, then the body of the while is indented, if the if statement comes in the body of the while, then another indentation comes, so second level indentation, so in the picture the same thing will be seen, which you will see in the code, very easy to identify, so I think you should practice drawing some loops in terms of flow charts, use the while loop, and then with that, put some nested ifs, put a nested while of Bisha, see what happens, because we will cover the nested loops as well, let's look at another problem for a second, simple problem, but something that we use, see you know the factorial, you must have heard the factorial, you must have used it, factorial of a number, its definition is, if you have a number n, then n factorial is defined as, n multiplied by n minus 1, multiplied by n minus 2, multiplied by n minus 3, and so on up to, multiplied by 3, multiplied by 2, multiplied by 1, so it's a series of multiplications, can we get a factorial of a number, by writing a program, and if we can get a factorial, then we must get it out of the loop, we must write it straight out, so now I won't be washing the whole adding of 10 numbers, now you must have so many skills, that you must think about it, you have to do the same thing again and again, so for this, let's jump to the factorial program, using a while loop, again, let us keep the concept of generic programming, let us work easily, first think that, if we get a factorial of 6 today, then maybe in the evening, let's calculate the factorial of 5 or 7, or calculate the factorial of 8, then let's use that as a variable, so factorial program, let's first look at the code, let's jump right there, I have a stream, main, opening press, what do we need, in the variables, we need the factorial of which number, so we say int number, by definition, these are integers, after that, next will come the answer to this, that variable called factorial, let's go ahead, you should see out and prompt, see the value of the number, so we have a queue, in terms of, which number factorial is being drawn, get it from the user, now let's come to the definition of factorial, so now the number we get, that int number, the value, so this will come in the while loop, now the while loop will be, while number is greater than or equal to 1, because in factorial, we have to count down, n, n minus 1, n minus 2, n minus 3, until it reaches 1, so our while condition is, while number is greater than or equal to 1, I have told you the while condition, but before that, another very subtle thing, we have done some programs, okay, some is equal to some plus number, etc., and we initialize some to zero, the value used to be empty, and then we used to collect the number, this problem that we are tackling right now, that is factorial, in factorial, our result will come, we have kept that variable, its name is factorial, that result is the result of multiplication, every time, whatever number we have, we have to multiply something, so now the question is, which value do we have to initialize factorial? think, we will keep zero, if we initialize factorial with zero, then when we multiply n by n minus 1, then we will say factorial is equal to factorial times number, factorial's value is zero, times number will be zero, whatever is fun, factorial's value will be zero, so this also needs to be taken into consideration in programming, whenever you are taking something's products, or repetitive product, then usually we initialize it from one, in this case also it makes sense, that the variable has factorial, its initialization has to be from one, the number you have got from the user, and the factorial is initialized by one, now the loop is shown, while number is greater than or equal to one, the loop's body is here, factorial is equal to factorial multiplied by number, so the first time it was one, second time the number will come in it, next line, now the equation we are solving is, n multiplied by n minus one, i.e. which number has to be multiplied, the original value of the number is decremented by one, so the next line will come in the loop, number is equal to number minus one, and remember there was a condition above, it was greater than or equal to the condition, so now the number has started to go down, and eventually it will reduce from one, so the loop will end, now if you want to run this program manually, I think it's a good exercise, you put the conditions, make a small table, what will be the value of the number, what will be the value of the factorial, and then run the loop from the hand, first this line came, then this line came, that the value of factorial will continue to build up, do it from a small number, don't do it with a very large number, otherwise you will have problems, but nonetheless, this is also an interesting exercise, simulation by hand, so you might want to try it out, and see that you can run the program with your hand, and then you can always come back, because factorial, when numbers pass a little, the answer becomes so big, that it will be very difficult for you to verify so try this out, write the factorial program, run it for various values, again good point for discussion board, what is the value, whose factorial becomes so big, that it cannot be stored in the memory of the computer, as an int variable, try finding that limit, small while loop program, make a flow chart, practice all of these things, practice makes perfect, it has to be done, program a lot, practice a lot, draw your flow charts, it's important for you to do that, one, while finishing, I will tell you a property of the while statement, in the next lecture, there will be a lot of discussion on this, see in the middle, we reached a place in this lecture, when I said, if we find the sum of the first zero integers, we discovered that the while loop is not running, the first condition failed, the statements were not executed, and we came out, so a property of the while loop is, that it executes zero or more times, think about it, it can run at a zero level, depending on the condition, or it can run more than that, we will see its variants, we will see other types of loops, where at least one loop will run, this is not a property of the while loop, it can run at a zero level, so please keep that in mind, today's lecture, was on repetition structures, that is, looping structures, we discussed one loop of C, which is the while loop, the good thing is, the meaning of the while loop of C, is used in C, similarly, as we said, if and else are English words, and the same meaning is used for decision making, in the C language, so it's very easy to learn and understand, again, if you have a list of C keywords, I would strongly recommend that you keep looking at those keywords, so that you know which words are used as variable names, we made a flow chart of the while structure, and we looked at its construct, again, I would strongly recommend that you draw yourself many, many, many flow charts for the while statement, and you have two important programming constructs, one condition, if else, or if simple, and one loop, while loop, along with that, you can write 90% of all programs, moving forward, we will talk about structured programming, we haven't mentioned it yet, in that, I will tell you that you need these two things, to write any and all programs, until then, excuse me, goodbye.