Code::Blocks Forums

User forums => Help => Topic started by: ttdub on February 21, 2011, 10:26:27 am

Title: may be a stupid question but please help
Post by: ttdub on February 21, 2011, 10:26:27 am
I am extremely new at this, but I was making my new code and it won't work the way I want as much as I try. For some reason, when I put in a number that ends up less than 20, it outputs what I put for both less than 20 AND moire than 20... I just don't understand why. Here's the code:

#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;

int main (int nNumberofArgs, char* pszArgs[])
{
int nAdd;
cout << "input number";
cin >> nAdd;

int rAdd = nAdd-3;
if (rAdd < 20)
{
    cout << "rad is less than 20" << endl;
}
else (rAdd > 20);
{
    cout << "rad is greater than 20" << endl;
}


system ("PAUSE");
return 0;
}
Title: Re: may be a stupid question but please help
Post by: Jenna on February 21, 2011, 10:30:03 am
Not related to C::B in any way and therefore violating our forum rules.

Topic locked !