mm:ss - C Code - Scratch Code 0:28 - While (True) - Forever 1:22 - While (Boolean-expr) - Repeat Until 2:58 - Do While Loop - N/A 3:27 - For Loop - Repeat (n times) 6:43 - Use Cases for each loop type 6:50 - While Loop Use Case Example 7:14 - Do While Loop Use Case Example 8:00 - For Loop Use Case Example
mm:ss - C Code - Scratch Code 0:28 - While (True) - Forever 1:22 - While (Boolean-expr) - Repeat Until 2:58 - Do While Loop - N/A 3:27 - For Loop - Repeat (n times) 6:43 - Use Cases for each loop type 6:50 - While Loop Use Case Example 7:14 - Do While Loop Use Case Example 8:00 - For Loop Use Case Example
For the end part of the for loop, why didn't you write it as "increment/decrement"? Since you can also decrease a value in a for loop, it seems that it would be more accurate.
I really need someone to look at my code for the mario /less assignment. I think my do...while loop is backward or something. I need email addresses for the Tks
Can someone help me with this for loop problem? for (int k = 0; (n < j); k++) { (random code) } printf("This is your total: %i " , k); the code only works if I declare int k; before the for loop. if I don't declare k before the for loop, error says k (in the printf function) is undeclared. I thought initializing in the for loop would let me print k
not an expert but my instincts are saying that the variable which you declared in the loop is limited to the loop itself! and as you kept the printf function outside the loop, the "k" is really undeclared in the eyes of the compiler. cant be sure, but i feel that this may be the reason.
@@TheLolPoster I did it after a lot of work. It's definitely easier than I thought it would be, but the logic just didn't come to me naturally at all. I guess that's why practice and hard work is a thing, to develop that natural way of thinking through problems. Y'all can do it. Just keep trying. Feel free to look up hints, it's better to get through a problem and understand the logic than spend a week on it before giving up. Even if you cheat on one question, you're still improving a little bit, and you'll be able to better understand further problems of a similar caliber.
You know that he loves saying "My name is Doug Lloyd and this is cs50". Just see him smile!
I’d smile if I got to say it too
mm:ss - C Code - Scratch Code
0:28 - While (True) - Forever
1:22 - While (Boolean-expr) - Repeat Until
2:58 - Do While Loop - N/A
3:27 - For Loop - Repeat (n times)
6:43 - Use Cases for each loop type
6:50 - While Loop Use Case Example
7:14 - Do While Loop Use Case Example
8:00 - For Loop Use Case Example
Thanks,
you're a real MVP!
Keep up d good work bro!
Currently this is my favourite short from all. Simply explained and enough deap.
I suggest y'all add time stamps, so when we're revisiting these videos, we can just skip to reviewing 'for' loops for example
Cheers, love you
mm:ss - C Code - Scratch Code
0:28 - While (True) - Forever
1:22 - While (Boolean-expr) - Repeat Until
2:58 - Do While Loop - N/A
3:27 - For Loop - Repeat (n times)
6:43 - Use Cases for each loop type
6:50 - While Loop Use Case Example
7:14 - Do While Loop Use Case Example
8:00 - For Loop Use Case Example
doug lioyd' class is so easy to understand the concept of c. and i have learned so much from him. really great experience to learn code here in cs50.
int main (void)
{
printf("CS50 IS THE BEST
")
}
Not to be that guy but you didn't return 0 and you missed a semicolon in the printr function.
For the end part of the for loop, why didn't you write it as "increment/decrement"? Since you can also decrease a value in a for loop, it seems that it would be more accurate.
i think you are right
Well, watching this, maybe my for loop bool is incorrect, but I can't seem to fix it....
what is a nested loop
Cheers dude
where can I get the slides from the shorts?
thanks a lot for everything
I really need someone to look at my code for the mario /less assignment. I think my do...while loop is backward or something. I need email addresses for the Tks
with regards to the for loop, why does the counter not reset to one each time the code repeats?
The first parameter (for i=0) is just the initializer, the last one (i++) makes sure it increments each time.
just because
why is i++ in the for loop?
It's a mathematical method: plus one ( + 1 ). It helps you to count how many times you want to do this: for loop
Can someone help me with this for loop problem?
for (int k = 0; (n < j); k++)
{
(random code)
}
printf("This is your total: %i
" , k);
the code only works if I declare int k; before the for loop. if I don't declare k before the for loop, error says k (in the printf function) is undeclared. I thought initializing in the for loop would let me print k
not an expert but my instincts are saying that the variable which you declared in the loop is limited to the loop itself! and as you kept the printf function outside the loop, the "k" is really undeclared in the eyes of the compiler. cant be sure, but i feel that this may be the reason.
@@LeelaSankharM you are right, I figured it out after asking a friend and doing some more research. But thank you for helping!
@@omgitsalion999 glad that you've found the answer before! happy learning
Can someone tell me, is it possible to write a do while loop with multiple conditions?
with 'or' operator why not
harika bir kanal harika paylaşımlar üyeniz oldum zil açık kolay gelsin
Thank you sir 🙏🙏🙏
great job
thanks sir
Anyone else completely stuck on the easy mario problem? Lol. I feel like I am way too dumb to be a programmer.
same here man
same boat
did you do it ? :)
@@TheLolPoster I did it after a lot of work. It's definitely easier than I thought it would be, but the logic just didn't come to me naturally at all. I guess that's why practice and hard work is a thing, to develop that natural way of thinking through problems.
Y'all can do it. Just keep trying. Feel free to look up hints, it's better to get through a problem and understand the logic than spend a week on it before giving up. Even if you cheat on one question, you're still improving a little bit, and you'll be able to better understand further problems of a similar caliber.
@@Alziax I'm currently stuck hard on pset1, i feel like i know what i need to do i just can't put it into code just yet!
RESPECT ++
Pretty clear. Thanks!
👍