|
|
while(0>(x, y, r)>0)
while(r != 0)
. The values of x,y are completely ignored.using namespace std;
)
while(0>(x, y, r)>0)
to while(r!=0)
solve my problem? I'll try. But this kind of thing worked in my other programs.So, will changing while(0>(x, y, r)>0) to while(r!=0) solve my problem? |
In this, all my other programs work without the namespace, int main(), iostream, etc. kinds of stuffs that you have mentioned in your reply. |
[ BTW, I did not get what you said in first two paras :( ] |
|
|
|
|
Take a look at line 16: sinn=y/r; You are dividing by 'r' here. If r is zero... then you are dividing by zero. There is no if statement which prevents the division if r is zero. Look at line 81: sinn=y/r; Again... you are dividing by r. If r is zero, then you are dividing by zero. Your if statement on line 24 will print a different message... but it does not stop this division because this division is outside the {braces} of that if statement. |
tann=y/x;
OK. So what's the latest compiler? Is it Borland C++ Compiler v5.5? |
Is it possible to state a condition after declaring a formula? |
|
|
And I'm thinking of buying Visual Studio 2013. Is it a good idea? |
|
|
What is doOutput? I haven't seen such coding anywhere and I have not been taught any such thing. |
Just to be clear - are you saying that you've literally never seen functions before? |
|
|
You don't declare formulas. So no. When you put in a formula... that is where the program will actually do the computation. Don't actually put in the formula until you want to actually do the division. If you want to do the division only if the denominator is nonzero.... then put it in an if statement:
|