Discussion Locked

seemed to have made infinate while loop

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

hi i seem to have made an infinate while loop i was wondering if someone could point this newbie to where he went wrong. here's the source code....

#include
#include
using namespace std; //introduces namespace std
int main( void )
{
int tasknumber = 0;

while(tasknumber < 9)
{
if(tasknumber % 2 == 0)
{
cout<

1 reply

by john torjo

you forgot to increment, within the loop.
should have been similar to:
while(tasknumber < 9)
{
if(tasknumber % 2 == 0)
{
cout<

This discussion is closed to new replies.