// Project 10 - More Loops.cpp : main project file.
#include "stdafx.h"
#include <iostream>
using namespace std;
int forLoop()
{
for(int x = 1; x++ <= 100; cout << "FOR!?\n");
return 0;
}
int whileLoop()
{
int x = 1;
while (x++ < 100)
{
cout << "WHILE!!!\n";
}
return 5;
}
int doLoop()
{
int x = 0;
do(cout << "Doo doo\n");
while (x++ <= 10);
return 9001;
}
int ifCompact()
{
int a = 9;
int b = 11;
(a >= b) ? cout << "Hello!\n" : cout << "Bye\n"; //?: = if true, do this, if not : do this
return 2 * 13;
}
int main()
{
forLoop();
int x = forLoop();
cout << x << endl;
whileLoop();
int a = whileLoop();
cout << a << endl << endl;
doLoop();
int z = doLoop();
cout << z << endl << endl;
ifCompact();
int b = ifCompact();
cout << b << endl << endl;
cout << "Press any key to exit.";
char z;
cin >> z;
return 0;
}
Trying to learn c++ and I'm at this point where I'm learning about different kinds of loops.
In the main function where I call ifCompact() it should say "Hello" if the statement is true, and "Bye!" if the statement is false. I've looked over the whole thing and I can't figure out why when I compile+run it, "Bye!" gets said twice as if that function is being called twice, but I only called it once in main().
Any pros help a newb out?

using microsoft vc++
windows 7 x64