C Programming Tutorial - 26 - do while Loops

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

Sucks for the student who got 0 on the first test.

dariacuna
Автор

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%.

muhammedzariff
Автор

It demonstrates the Do while loop well, but I wouldn't choose 0 as the quit command since you can score 0

michalpitr
Автор

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?

Wheelygonzales
Автор

Bucky knows lots of stuff that's for sure. Great vid.

tonyn
Автор

had troubles understanding the condition part, but understood it after watching this, thankyou!

overblues
Автор

It would be better if it were zoomed in.

maruf
Автор

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

darkygames
Автор

Good execution of the joke made it even funnier

briankiprono
Автор

Does 'grade += scoreEntered' equals this code 'grade = grade + scoreEntered' ?

DraoN
Автор

why you are using "grade" in this program. instead use total

ajay
Автор

Your tutorials are awesome but you should increase the font size from next time

NavjotSingh-bzrn
Автор

Hi. How about when you need to have an output like this:

OUTPUT
Enter a number: 1
Enter a number: 2
Enter a number: 3
Sum = 6

Is it the same process?

toni_
Автор

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?...

lolofuk
Автор

whats the point of the do part? why not just start off with the while (scoreEntered != 0) and get rid of the do part all together?

gabemorris
Автор

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

montanalegare
Автор

It's not a bad programming practice if we leave the false condition code area empty in the shorthand if statement right?
#include <stdio.h>
#include <stdlib.h>

int main()
{
float grade = 0;
float scoreEntered = 0;
float numberOfTests = 0;
float average = 0;
printf("Press 0 when complete. \n\n");

while(true){
\n", numberOfTests, average);
printf("\nEnter test score: ");
scanf(" %f", &scoreEntered);
(scoreEntered == 0) ? break : ;
grade += scoreEntered;
numberOfTests++;
average = grade / numberOfTests;
}


return 0;
}

shadowmeth
Автор

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

nali
Автор

Is there a way to clear the screen? (like "cls" in batch) And is it possible to change the color of the letters? (like "color .. " in batch)

thecasper
Автор

guys, i typed in the 16th line scanf("%.0f", &scoreentered); and thanks to that my program kinda wasn't working ( please try this )
can i know why?

MultiAkram