Skip to main content
1 vote

credit pset1 cs50 sum while loop

A problem I found is at line 47 of the code (the second while loop): while (power <= 14) { sum += (number % 10); power += 2; number = number / pow(10,power); } I think you meant the ...
Ricardo David Antonetti's user avatar
1 vote
Accepted

Why does this become an infinite loop?

The infinite loop lies here: while(j < rows) { printf("#"); (i++); } The loop depends on the value of j being updated and eventually not less than rows. Since j is never changed ...
Cliff B's user avatar
  • 69.1k
1 vote

While Loop in C only executing once and then stopping

So after you get an error message that says "Out of Range", when you try to enter another value that is out of range, the loop stops. There is a "clearKeyboard()" function that is called in here - ...
bbNicky's user avatar
  • 11
1 vote

clang doesn't like while loop

Error message is caused by your ; after int main (void), making it a function declaration rather than a function definition. For a function definition, a code block in curly braces follows that line, ...
Blauelf's user avatar
  • 21k

Only top scored, non community-wiki answers of a minimum length are eligible