C++ IS fun.
// ConsoleApplication2.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
//
#include "iostream"
using namespace std;
int main()
{ int in0 = 0;
int counter = 0;
cout << counter << endl;
do
{
counter = counter + 1;
if (counter == 5)
{
in0 = 1;
}
if (counter == 4)
{
cout << "Hello, this is simple for those who know what they are doing. counter = 4" << endl;
}
cout << counter << endl;
cout << "Hello, this is simple for those who know what they are doing." << endl;
}
while (in0 == 0);
system("pause");
}
Getting this to work was a b****, however. It actually stumped the instructor. The main problem? if (counter == 5) was if (counter = 5) See if you can figure out what happened
Also:
Project1.zip (128.99K)
downloads: 2 Cover your ears.
Sign In
Create Account


It probably ran forever.