Hi... I made this simple programm but now I can understand why I am having problems when entering number from 50 to 100... it always says in the end "00 a 49"... help pls...
okay, you declared two x, one that is global seen by all, and other is seen by main only, when you cin>>x; in main the value entered will be in x which is at main scope. Now, when you call minus100(), that function doesnt see whatever declared in the main() scope; thus, it will look for another x (which will find it at the global) and will use it. Since your global x has no value (NULL), if(x>=50) will never be true since you are comparing nothing to 50 (nothing could be anything). To solve this: just remove x declared in main so that the input is entered into the same x that the function will look into.