 Hello friends, I am Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. In this video, I am going to explain how you can multiply x with y without using multiplication operator. So the important thing is we will not press multiplication key while implementing the program that I am going to explain if we want to multiply a number with another. So before starting, if you want to watch more programming related videos, so you can go to detail or description of this video. So you will find links of various playlists so you can watch programming related videos by following those playlists on my channel. So now I am going to explain the logic first, then I am going to implement the program so that you can understand it. So let's say we have two variables x and y and we need to multiply x with y, sorry x with y, but we don't have to use multiplication operator. So these are two values x is 5 and y is 7. So if we multiply 5 with 7, so we can do this thing and we will have one answer. So this we are doing using multiplication operator, but in this scenario, we don't have to use this. We don't have to use this. So we can't multiply 5 with 7. So what will be another alternate? We can do this thing. So see how many times I added 5. 1, 2, 3, 4, 5, 6, 7. So if you add 5, 7 times, then the result will be 5 into 7. If you add 5, 7 times, then the result will be equivalent to the result of this expression. So we are going to use this one. So I hope you understood. We will be adding x, y times. And to implement this, I am going to use a feature of C that is no. So we easily identified which will be added. So we need to add 5 that is told in x. So every time x will be added and how many times it will be added, y times. So our loop will be repeating y times. So now I am going to implement this. You can use a printf. You can read two values, x and y. Those values will be provided by user and you can read them using scanf and they will be stored inside x and y. Now after reading, you can apply a loop and this way you can implement that. I is starting from 1 and it will go to y. Now inside this loop, you can apply this addition operation. So you don't need to write 5 plus 5 plus 5 again and again. This will be done by the loop. So here I am writing s equals to s plus x. And after completion of this loop, I can print result equals to %d and s. So s will be having the final multiplication result. So if you go through with this program, you can see I have not used multiplication sign anywhere. I just used plus and other things. So now let's say x is 5, y is 7 and initially s is 0. That is initialized here. Now I is 1. So first time value of I is 1. Check this condition. 1 less than equals to y. So y is 7. So 1 is less than equals to y. Then perform this s is 0 and x is 5. So 5 plus 0 will be 5. So first time x is added to s and stored in s. Then at I plus plus, I will become 2. Check 2 less than equals to y. So y is 7. So 2 less than equals to y is also 2. Now perform this s plus x. So s is 5, x is 5. So it will become 10. So 2 times 5 is added. Now again I plus plus. So this time I will be 3. 3 less than equals to y. So y is 7. Again it is 2. Again s plus x will be performed. So right now s is 10 and x is 5. So new value of s will be 15. So this way you saw this loop will repeat 7 times because y is 7 and 7 times x will be added to y so that you will be having this kind of thing. So if we multiply 5 with 7 or if we add 5, 7 times. So both are same in case of mathematics. So this is a trick. This is a trick that can be asked in interviews like can you do this operation without using multiplication sign. So you can immediately recall loops like we can do this kind of operation with the help of loop. So you can explain this example and I hope you understood how I explained this problem. After completion of this loop you can print the value of s. So after 7 rotation s will be having 35. So if we multiply 7 with 5. So the result will be 35 that will be printed with the help of this printer. And remember that this printer will come after completion of this loop. Don't write it inside the loop. So this way this program works. So I hope you understood whatever I explained in this video. If you want to watch more programming related videos you can open my channel. Go to playlist and there you will find more than 1000 videos related to programming. So do watch them and I hope you understood whatever I explained in this. So thank you for watching this video.