Author Topic: may be a stupid question but please help  (Read 2542 times)

ttdub

  • Guest
may be a stupid question but please help
« 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;
}

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: may be a stupid question but please help
« Reply #1 on: February 21, 2011, 10:30:03 am »
Not related to C::B in any way and therefore violating our forum rules.

Topic locked !