- This topic is empty.
Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
- You must be logged in to reply to this topic.
IT, Programming, & Web Development › Forums › CS50’s Introduction to Computer Science by Harvard University on Edx › Week 1: [C] – Data Types, Operators, Conditional Statements, Loops, and Command Line › Understanding infinite loop with while loop
Tagged: infinite loop, loop, loops
#include <stdio.h>
#include <cs50.h>
int main(void)
{
int h;
h = get_int("h ");
while (h > 2)
{
printf ("ffff");
}
}
As any integer greater than 2 entered, there is an infinite loop (ffff printed infinitely). Could anyone please explain why so.
Reply
https://cs50.stackexchange.com/questions/41832/understanding-infinite-loop-with-while-loop[learn_press_profile]