C Programming Tutorial 71 - Nested For Loop

preview_player
Показать описание


~~~~~~~~~~~~~~~ CONNECT ~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~ SUPPORT ME ~~~~~~~~~~~~~~

🅑 Bitcoin - 3HnF1SWTzo1dCU7RwFLhgk7SYiVfV37Pbq
🅔 Eth - 0x350139af84b60d075a3a0379716040b63f6D3853
Рекомендации по теме
Комментарии
Автор

Just a tip for anyone who may be confused because this confused me for a long time and it is not mentioned much in many tutorials for nested for loops.


Remember that the initial outer for loop variable maintains it's incremented variable value. The nested inner for loop resets back to the initial variable value each time it is entered. This is to do with scope.


I had a hard time figuring this out because I would initialize two variables in the same place but run into this problem still. Hope it helps!

LimeWitness
Автор

The outer loop is only used for counting the number of times the inner loop should print the print function, after every print statement in the inner loop, the program exits the inner loop and go back to the outer loop. Then the outer for loop gets initialized to i=1, now the program enters the inner loop, this time the inner for loop gets initialized to 1 instead of 0. So 1 will be printed and then due to k-- decrement, the next number will be 0, and also due to the print("/n"); at the end of inner for loop, the output will go to a new line in output console. Ask me in comments if you have any doubts, I was confused as well at first as it looks confusing.

christypaul
Автор

Nested? More like bested...by no other YouTube C tutorial! Thanks again for making all of this wonderful content.

PunmasterSTP
Автор

Caleb....I must confess this is my nightmare as a beginner (nested loops - for, while or do while). So far u have helped me cement understanding of the preceding concepts. Please help with videos that carefully explain the rational for for loops, the concepts and probably numerous use cases just like in the previous lectures. This aspect so confusing man. Thanks

mohamedkanu
Автор

Caleb, you gotta add the last 30 vids of this series to the C tutorial playlist. It takes maybe 5-10 minutes at most.

xynx
Автор

I really enjoy how he started talking about food at the middle of the code.

Tuan-fqsm
Автор

Your explanations and videos for C Programming are incredibly helpful. Thank you for sharing this information and your organization!!!

Drumbum
Автор

could not find anyone else doing an example of this one. TY

DTBOSS
Автор

Thank you so much, this tutorial is carrying me through university!

eclipse
Автор

You’ve saved my life. I’ve been eating more pizza since this video and I’m now happier having had more pizza.

reecetrahan
Автор

you definitely deserve more and more, thank you much

nalindapriyamal
Автор

thank you man, i am in college and this helped me a lot!

mk_scar-
Автор

This is amazing. Thanks for explaining in such an easy way

NNNedlog
Автор

02:23 Isn't by convention the inner loop letter j? It is the next letter after i.

dxtr
Автор

nested loops are just cogs. As one turns, so does the other.

jadoaesra
Автор

What I learned from this video? Pizza > Tacos. Thank you for the clarification ;)

owencf
Автор

tqsm for the tutorial, though im curious whats the name for ur outro😅, ik its "rx savagez-wolves" but theres weird noise every few seconds + ur vid is 2 yrs older than his

Blank-KongRuYe
Автор

2:35 ayo, idk if you're talking about taco bell, but mexican tacos are better than pizza, no discussions

JuanPabloHernandezRamirez-se
Автор

why do you print %d? what does that do?

Calam
Автор

I have 3 for loops that I should merge to two for loops can someone help me?

elaceaceak
visit shbcf.ru