Borlnad C++ eroor with if

Hi! I have a problem in borland (i am new to borland, before i worked in dev c++ and codeblockxx) with the "if".
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <iostream.h>
void main(){
int m, n, a3, a2, a1, aux;
cout<<"\n\n\n Enter a number: ";
cin>>m;
cout<<"\n\n\n Enter a number: ";
cin>>n;
if(m<n){
aux=m;
m=n;
n=aux;
}
a3=m;
a2=n;
a1=m-n;
while(a1>0){
a3=a2;
a2=a1;
a1=a3-a2;
}
if(( a3 == a2)  and (a2 == 1 )) cout<<"Numbers are.";
if ( ! (( a3 == a2 ) and (a2 == 1 )) ) cout<<"Numbers aren't.";
}

Thanks in advace... Isengardium
Last edited on
First of all I do not know what is the "if function". Secondly before using some C++ statement please read a book on C++ how to write such a statement.

I think that the problem is that and is not defined as keyword in Borland C++. Change it to &&
Last edited on
Thanks...
i am new to borland, before i worked in dev c++ and codeblockxx

Sounds like a step backwards. Borland products are old. Code::blocks is much more up to date and therefore recommended.

Though nowadays the updated Borland product line lives on under the Embarcadero company. http://www.embarcadero.co.uk/
Topic archived. No new replies allowed.