How To Zoom IN : Press the windows key with "+" key then click on the "views" option after that select full screen. and increase the magnification to 200%.
Where do you learn all of the things you teach in your videos? I am impressed by how much stuff you have on your channel and the variety of content from biology to computer programming to 3D animation. It's amazing! How do you do it?
It's not too bad... All languages are very similar and most are similar to C. I know 4 possibly more, computer languages. To me it's not about knowing one language, its about using the right language for the right problem.
Dude I'm So confused About Do while loop..You r good..but u used too much Floats ha ha that's Blow my mind..I think I can understand After watching 3-5 times...Keep it up bro nice tutorials
I am trying to practice more "the do while loops" and I came across to this: Can I use characters (char) to test in a WHILE? or only numbers? I would like to create a program that requests the user to enter a name (predefined) and while this name is not typed the program will keep asking to enter the correct the name. I hope this make sense :) It didn't work: int main() { char name; printf("Once you have typed the correct name the program will stop! "); do { printf("What is the correct name?", name); scanf(" %c", &name); }while (name != 'alex'); return 0; }
You can, but you made few mistakes. You don't need "name" in the end of this line ---> printf("What is the correct name?", name); Second mistake is that you typed %c insead of %s. You use %c for a single character, and for name you have to use %s. Other than that i think code should work just fine.
You're welcome. I don't know, maybe you entered the uppercase instead of the lowercase or something like that. Let me know what the problem was if you fix it.
lol your code has a bug, not in syntax but the algorithm. if a student gets 0 which still has to be calculated in the average the program quits. Awesome job with the tutorials though!
Hey Bucky, since you are now uploading videos and starting new series could you please make a tutorial series on scala ? It would be much appreciated :)
This comment is 6 months ago. You must already know it . I think you should get rid of the .0 before the f, because it is in scanf. But, I don't know the reason why scanf doesn't need it.
A great tutorial! A question: scanf() line: instead of scanf(" %f", "ScoreEntered"); I wrote scanf( " %.2f", "ScoreEntered"). The program only run once. What makes difference between %f and %.2f here? Thanks
How do i retun back to my main function after the while condition becomes false. Once my while statement becomes false my programs ends and i need it to continue
I have a question...Why If I put only one test with score enetered 54 and then I put 0 the average is calculated both with 54 and 0 so if I print average after the loop the result is 27?...
It's not a bad programming practice if we leave the false condition code area empty in the shorthand if statement right? #include #include int main() { float grade = 0; float scoreEntered = 0; float numberOfTests = 0; float average = 0; printf("Press 0 when complete. "); while(true){ printf("Test:%0f\t\tAverage:%.2f ", numberOfTests, average); printf(" Enter test score: "); scanf(" %f", &scoreEntered); (scoreEntered == 0) ? break : ; grade += scoreEntered; numberOfTests++; average = grade / numberOfTests; } return 0; }
how can i compare a string? for example #include #include int main() { char cmd; printf("Welcome! "); do{ printf("COMMAND>"); scanf("%c", &cmd); }while(cmd != "EXIT"); return 0; } i know i cannot do it because c recognize this as addresses. i have tried some things in stack overflow with no results. How can i compare the cmd string to not be EXIT in order to repeat? and when EXIT then exit? please help
Can't you make that character cmd a string of like 50 indexes (because I have seen some really big commands of windows and linux). Because in the end test of do loop you are comparing a characrer to a string which is wrong since if cmd is a character it would never be able to hold the string "EXIT"
once someone knows how to code in one language(OOP) he might already has enough idea how to code in other languages (mostly). Also of course bucky for sure has so many programming books. Once I watched his video(probably C#) and later I was reading some programming book I realized bucky took that example/followed that book. Which is absolutely fine. At least someone taking initiative to lean and teach others "FOR FREE"
I have a problem. The "grade += scoreEntered" doesn't work when I do it. Neither does "grade = grade + scoreEntered". I don't know what I'm doing wrong. My compiler is Dev C++, could that be an issue?
Is it possible to add code after the final while statement? I'm trying to create something which calculates my final term grade based on individual test scores. I extract all the info in the 'do' section and then use a checking command at the end of the 'do' section, somethings like: printf("Is this information correct?"); Then I use scanf too save the string, yes or no. Then in the 'while' section I have: }while (Check == 'No'); /*Grade calculation goes here*/ printf("Your final grade for the first term is 77."); So are we allowed to use 'printf' after the 'while' line? I keep getting an error. If we aren't allowed, how can I rearrange the code to accomodate what I want to do? Thanks.
Zeeshan Asghar You would just put it in an if statement after the do while loop. }while (scoreEntered != 0); if(scoreEntered==0){ /*Grade calculation goes here*/ printf("Your final grade for the first term is 77."); }
Bucky, i feel that you can combine grade and scoreEntered as one variable. Actually i still dont understand the advantage of the do... while loop over the while loop in this example. Hope you can convince me what do... while can do but while cant.
+fooser Old, but I'll answer. I think the difference between them it's property of pause. Both creat a input output data system, but"While" runs the programm and you can't stop it. "do... while" you can put "scanf" to creat an manual loop. So the user control de loop, not the computer. If we imagine every pause as a changing of information, we can creat a lot of things.
But the "while" can only run a comander and check the condition, and so go on. "Do while", after make the comander e check the condition, can receive another and different command, and check the condition again. It's manually, and can process information individualy. I'm from Brazil, I'll pass you a link, it's in portuguese, but there's only two images: the first is while, the second one is do while. The words are pretty similar, you can understand. www.ic.unicamp.br/~jpaulo/cursos/mc102/2s2007/aula6.pdf
Just make them type something else instead, like a number over 100 which isnt possible for you to actually get on a test. like for example make the number 200 and make the condition while(scoreEntered
guys whenever I .build and run. the program it's stopped working I don't know why only in "if" and "loops" it's says : hasanC.exe has stopped working please help
Let's see a practical example. Imagine you are making a program for a school in which each student has to enter their weight. Now you can use both loops. int weight; scanf(" %d", weight); while(weight < 0){ scanf(" %d", weight); } int weight; do{ scanf(" %d", weight); }while(weight < 0); So as you can see do loop is probably more easier to understand and more easy to debug to (at least for me it is).
Hey I don't know if you'll read this hopefully you do and reply at the least.. but I wanted to ask you can you do some new updated iPhone Development Tutorials with the new iOS 7 And the new Xcode etc and make it more deep into developing An App for the newest iOS 7 well i know iOS 8 will be out soon but for iOS 7 with the latest Xcode please?
yo, umm, i was trying out this code, but everytime i enter a number, my PC crashes, can someone run this in their computer and see if it is just cuz my pc i slow int main() { float overall = 0; float entered = 0; float times = 0; float avg = 0; printf("AVERAGE CALULATOR press 0 when complete "); do{ printf("current average: %.2f ", avg); printf("input number: "); scanf("%f", entered); overall += entered; times++; avg = overall / times; }while(entered != 0); return 0; }
I think you want to say that the scoreEntered starts at 0. We can change while(scoreEntered !=0) to while(scoreEntered!=200), it should be okay to use a while instead of a do while. int main() { float totalScore=0; float numberOfTests=0; float scoreEntered=0; float average=0; printf("If you enter all your scores, press 200. "); while(scoreEntered!=200){ printf("%.0f Test(s) Average:%.2f ", numberOfTests,average); printf("Enter your score:"); scanf(" %f", &scoreEntered); totalScore+=scoreEntered; numberOfTests++; average=totalScore/numberOfTests; } return 0; } I am a newbie. If I am wrong, plz correct me. :)
Hello Mr. Bucky can you please reduce the advertisement, it is so irritating and only in 5 minutes of video there are 3 advertisement, 16 seconds each,,,
guigrillo101 Perhaps you should be suggesting he make a video on the basics of English rather than advanced programming, it'd do you quite a bit of good.