C++ FOR BEGINNERS (2020) - For loop, How to calculate factorial of a number PROGRAMMING TUTORIAL

  Рет қаралды 40,383

CodeBeauty

CodeBeauty

Күн бұрын

Пікірлер: 71
@CodeBeauty
@CodeBeauty 4 жыл бұрын
📚 Learn how to solve problems and build projects with these Free E-Books ⬇️ C++ Lambdas e-book - free download here: bit.ly/freeCppE-Book Entire Object-Pascal step-by-step guide - free download here: bit.ly/FreeObjectPascalEbook 🚀📈💻🔥 My Practical Programming Course: www.codebeautyacademy.com/ Experience the power of practical learning, gain career-ready skills, and start building real applications! This is a step-by-step course designed to take you from beginner to expert in no time! 💰 Here is a coupon to save 10% on your first payment (CODEBEAUTY_YT10). Use it quickly, because it will be available for a limited time. #include using namespace std; void main() { //The factorial of a number int number; cout > number; int factorial = 1; //6!=1*2*3*4*5*6=720 //for (int i = 1; i = 1; i--) { factorial = factorial * i; } cout
@angietodaro381
@angietodaro381 4 жыл бұрын
Your explanation is so detailed, its great. Thanks so much :D
@williamwelmans8648
@williamwelmans8648 3 жыл бұрын
You are an excellent teacher! Thank you very much!
@CodeBeauty
@CodeBeauty 3 жыл бұрын
🤗🥰🥰
@venkateshnayak3454
@venkateshnayak3454 3 жыл бұрын
The way you are teaching is very good..Thank you very much Saldina
@himanshugaikwad4998
@himanshugaikwad4998 3 жыл бұрын
Ur teaching is so beautiful 🤩 Just like YOU!!!!!
@CodeBeauty
@CodeBeauty 3 жыл бұрын
Thank you so much! 😃
@pbadibi
@pbadibi Жыл бұрын
thank you for existing 🦋
@CodeBeauty
@CodeBeauty Жыл бұрын
Thank you for being such a supportive and kind person 💗
@lukachilukusha6437
@lukachilukusha6437 2 жыл бұрын
Thanks a lot, I am learning from you different way to apply logic in programming. This is really helpful and I am how see different ways to solve different problems. Thanks 👍
@ЭлбекМелибаев
@ЭлбекМелибаев Жыл бұрын
just loved your explanation))
@dushyantvyas3589
@dushyantvyas3589 2 жыл бұрын
Can you please make a dedicated video on 'for loop' and 'while loop' in much greater details? such as nested loops, pattern programs using loops (basic to advance level). I'm having hard time with loops especially when it comes to pattern to draw a shapes using loops. I face difficulties behind its code generation from logic.
@iirxit
@iirxit 3 жыл бұрын
You are the best Can you make more examples of for loop please 🙏
@javanehmoghavi3954
@javanehmoghavi3954 9 ай бұрын
excellent, your trainings are awesome
@jwawong
@jwawong 3 жыл бұрын
Your videos are amazing! Thank you
@TheJoshuamcgowan
@TheJoshuamcgowan 2 жыл бұрын
super helpful. thx!
@onetwo-di9cv
@onetwo-di9cv 6 ай бұрын
Hi there, I am glad I find your brief tutorial for factorial using this for loop method. I tried & it's amazing!! But I find that the display result start to get wrong when it comes to number 13! & above. Is there any solution for this case?
@jaren_c
@jaren_c 2 жыл бұрын
Excellent explanation!
@Nishanth24s
@Nishanth24s 2 жыл бұрын
This tutorial was very much helpful, even though i dont have any Coding background and i can easily understand your explanation and get the output seamless. Please do make a tutorial on 1.Counting vowels. 2. Reverse a string. 3.To print Fibonacci series. Thank you Mam.
@ChrisVideosGreek
@ChrisVideosGreek 3 жыл бұрын
One day, you HAVE to teach the value outside functions it's pretty good.
@makoto7275
@makoto7275 3 жыл бұрын
Thank you so much!
@CodeBeauty
@CodeBeauty 3 жыл бұрын
🤗🤗
@MrHappyChappyX
@MrHappyChappyX 3 жыл бұрын
Hey CodeBeuty, total novice here and going through your videos have made the world of code less scary! I do have one question about the for loop, in the lines: for (int i = 1; i
@robertbruce5513
@robertbruce5513 3 жыл бұрын
initialization (i=1)-->then it checks the condition(i if the condition satisfies,it executes the statement/statements between the curly braces--> then it goes to the increment/decrement part(here,i++)-->then value of i is updated-->checks condition...it goes on and on until the condition is not satisfied or you use break statement. :V
@vk2ig
@vk2ig 3 жыл бұрын
You can think of it this way if you wish - the "for" loop works just like this implementation of a "while" loop: int i = 1; while (i
@Himalayas1921
@Himalayas1921 3 жыл бұрын
Thankxxx alot. Explained very well# keep it up.
@emilianoguillenmedina1066
@emilianoguillenmedina1066 4 жыл бұрын
regards from México
@CodeBeauty
@CodeBeauty 4 жыл бұрын
Saludos para el México y bienvenido Emiliano! 🤗 Increasing or decreasing the counter and setting the condition is considered the best practice to end the loop. However, there are other ways to terminate the execution of your loop if you really need to use them. Among those are break and goto statements, but if you make a habit of using these in large projects, you can find yourself maintaining code that is prone to bugs, very hard to understand (spaghetti code), and difficult to trace the control flow of a program. Because of that, I wouldn't encourage using them. Each time that you find yourself resorting to one of these in order to solve a problem, you should ask yourself how could you write that code without one of those, because in most cases it can be done. With that being said, there is one situation where they can be useful, and that would be for jumping out of deeply-nested loops since that would be often cleaner than using a condition variable and checking it on each level.
@celestiaaldreaams
@celestiaaldreaams 3 жыл бұрын
i did this in class today!! :)
@40wattstudio41
@40wattstudio41 Жыл бұрын
Any examples of when you would use a factorial in a game or software?
@DeviousBean
@DeviousBean Жыл бұрын
I've watched 3 other videos to try and understand this but they didnt help. I never really stuck with your videos cause the volume was always too low to hear but this time I bit the bullet and just raise my tv's volume to 50 despite having chrome at 100%. DEFINITELY WORTH BITING THE BULLET!! THANKS!!
@darius2955
@darius2955 Жыл бұрын
Thank you ☺️
@mahedirony3408
@mahedirony3408 2 жыл бұрын
Easy to understand take love
@dorianbs43
@dorianbs43 2 жыл бұрын
Thank you so much
@TheDora422
@TheDora422 3 жыл бұрын
Is the 3rd part (increasing/decreasing)of the For-loop always ignored on the first run? If it would just executed the conditions in the brackets after another ,the inserted number would be always In or decreased before executing the loop
@clarrisac750
@clarrisac750 4 жыл бұрын
Wanna ask I noticed that the factorial for number beyond 12 is inaccurate which most probably due to max number of integer is 2^31.How can I modify my code so that it can calculate beyond 12?
@CodeBeauty
@CodeBeauty 4 жыл бұрын
Exactly! The number that you want to store in your int type is too big, so it cannot be stored into an int. I have talked about that in this video kzbin.info/www/bejne/qaDPppmmgLV3rbs, so you can find more details there As far as I know, the long long data-type is the largest built-in integral datatype. So you can use unsigned long long int to store longer number and calculate the larger factorial. If you need an even bigger number than you'll have to use libs that are designed to work with extremely large numbers :D
@emilianoguillenmedina1066
@emilianoguillenmedina1066 4 жыл бұрын
I remeber that you can use doble instead int to doble the capacity of your variable, you can try it.
@anthonywilson8366
@anthonywilson8366 2 жыл бұрын
How can I increase in increments , do you have a video on that maddam?
@ChrisVideosGreek
@ChrisVideosGreek 3 жыл бұрын
l mostly use an intializer for i when using for loops :D
@jamieMcSorley-c4i
@jamieMcSorley-c4i 3 ай бұрын
I noticed if I enter a letter or a symbol, the program immediately runs through the code asking to enter the pin, but doesn't allow a pin to be entered, then the program defaults to "Blocked". Is there a way to debug this? I was thinking of using another if statement
@sayedosama4687
@sayedosama4687 3 жыл бұрын
god bless you ❤
@akanguven114
@akanguven114 Жыл бұрын
Hello, I am entering my info but the book has not been sent to my mail.. Thanks, I am Bosnian :)
@tcrawford8430
@tcrawford8430 4 жыл бұрын
How can I loop the factorial to adjust to the user input number in my for loop?
@mhdjaseem3195
@mhdjaseem3195 3 жыл бұрын
thanks, mam💕💖
@HarderThanCalculus
@HarderThanCalculus 2 жыл бұрын
to check for negative numbers I stuck in a little if else statement: if(number
@day4834
@day4834 2 жыл бұрын
Hi, this removes the negative numbers from the equation: #include using std::cout; using std::cin; using std::endl; int main() { int number, factorial = 1; cout number; if (number >= 0) { if (number == 0) cout
@amaulearyan9912
@amaulearyan9912 3 жыл бұрын
How can i calculate 100! ? as this programme show 100! = 0 and 20! = in negative ?
@trippics8465
@trippics8465 3 жыл бұрын
Pl.. make a video of find factorial no using recursion.
@CodeBeauty
@CodeBeauty 3 жыл бұрын
I already have that video: kzbin.info/www/bejne/g6jJp4t6m8aNm6s Hope it helps!😃
@trippics8465
@trippics8465 3 жыл бұрын
@@CodeBeauty Thanks Ma'am.
@trippics8465
@trippics8465 3 жыл бұрын
@@CodeBeauty Thank You So much dear.
@lopez5371
@lopez5371 2 жыл бұрын
I want the answer to be like for example as " 3!=3*2*1=6"... how can we do this???
@tankrides
@tankrides Жыл бұрын
double recursiveFactorial(int numBer) { if (numBer == 0) return numBer; return numBer + recursiveFactorial(numBer - 1); }
@jerseychou4323
@jerseychou4323 Жыл бұрын
tks
@ir4kli
@ir4kli 3 жыл бұрын
#include using namespace std; int main(){ int num,factorial=1; cin>>num; while(num>0){ factorial=factorial*num; num--; }cout
@simonasulcova8835
@simonasulcova8835 3 жыл бұрын
12:41 Can somebody please tell me, how did she do this? Every time I try this it comments like this: /* */. Id be happy for any advice, guys
@findikbabi
@findikbabi 4 жыл бұрын
I upgraded to code to include the possibilities of the user entering 0 or a negative number you can check it out and give me tips int number; cout > number; int factorial = 1; if (number == 0) { cout
@CodeBeauty
@CodeBeauty 4 жыл бұрын
This will work. Now, here is an idea of how you can do the same thing with less code. How about reducing your code to this: int number; cout > number; int factorial = 1; if (number < 0) { cout = 1; i--) { factorial = factorial * i; } cout
@findikbabi
@findikbabi 4 жыл бұрын
CodeBeauty Thank you
@omaristaitia5628
@omaristaitia5628 3 жыл бұрын
So nice Saldina you look like million Dollar
@imnot9923
@imnot9923 2 жыл бұрын
Comment for Algor
@zakariaaenajjachi2127
@zakariaaenajjachi2127 3 жыл бұрын
there is a more better method wich is just do factoriel = number *(number+1)/2
@Byynx
@Byynx Жыл бұрын
For the health of your eyes and overall health i strongly advise you to change the background to a dark color.
@yashjadhav6838
@yashjadhav6838 3 жыл бұрын
Thanks a lot
How I Turned a Lolipop Into A New One 🤯🍭
00:19
Wian
Рет қаралды 10 МЛН
How To Get Married:   #short
00:22
Jin and Hattie
Рет қаралды 32 МЛН
Mom had to stand up for the whole family!❤️😍😁
00:39
Миллионер | 1 - серия
34:31
Million Show
Рет қаралды 2,6 МЛН
Range Based For Loop | C++ Tutorial
9:15
Portfolio Courses
Рет қаралды 6 М.
C++ FOR BEGINNERS (2020) - Operators in C++ PROGRAMMING TUTORIAL
25:16
Running "Hello World!" in 10 FORBIDDEN Programming Languages
18:07
How To Think Like A Programmer
1:00:07
Coding Tech
Рет қаралды 2 МЛН
Выпрыгивает ли аккумулятор в iPhone 16?
0:43
ÉЖИ АКСЁНОВ
Рет қаралды 4,1 МЛН
Bu telefonda oyun oynamak ister misiniz?
0:15
Hakkı Alkan
Рет қаралды 4,8 МЛН
The damaged battery head isrepaired. #Battery #Repair
0:21
Hak Hang
Рет қаралды 29 МЛН
Дым-машина из Китая
0:57
Денис Шалюта
Рет қаралды 1,3 МЛН
Can I Unlock My Tesla With a Google Nest Mini?? 😳👀
0:31
Tesla Flex
Рет қаралды 853 М.