I am trying to make a program in C++, but I am a noob.

Help would be appreciated.

This is my program:

#include <iostream> #include<cmath> using namespace std; int main () { int a,b,X,ANTWOORD; for(a=100;a<=999;a+=1){ for(b=100;b<=999;b+=1){ X=a*b; if(X/100000<1){ if(floor(X/10000)==floor(X-10*floor(X/10))&&floor((X-10000*floor(X/1000000))/1000)==floor((X-100*floor(X/100))/10)){ if(X>ANTWOORD){ ANTWOORD=X; }; }; else if(floor(X/100000)==floor(X-10*floor(X/10))&&floor((X-100000*floor(X/100000))/10000)==floor((X-100*floor(X/100))/10)&&floor((X-10000*floor(X/10000))/1000)==floor((X-1000*floor(X/1000))/100)){ if(X>ANTWOORD){ ANTWOORD=X; }; }; }; }; };

You don't have to read the stuff between the "if-brackets".

But I do get the well-known

"expected primary-expression before else"-error.

I have been searching on the internet,

but I have not found the solution.

What (is/are) my mistake(s)?

By the way:

I know the program is not finished.

I still have no output.

But I first want to get rid of the else-error.

*** MOD EDIT: Added code tags. Please ***

This post has been edited by **JackOfAllTrades**: 07 December 2009 - 06:40 AM