program wont debug. any ideas

#include <iostream>
using namespace std;
int main () {
int n=6;
int dest=2;
cout<<"What floor are you on?"<<endl;
cin>>n;
cout<<"What floor are you going to"?<<endl;
cin>>dest;
do {
if (n!=2) {
n--;
cout<<"Now on 5"<<endl;
}
else cout<<"We are here!"<<endl;
}
while (n!=dest);

system("pause");
return 0;
}
Last edited on
A program won't debug if you have compile errors.
The following line has a syntax error
 
cout<<"What floor are you going to"?<<endl;


PLEASE USE CODE TAGS (the <> formatting button) when posting code. It makes your code easier to read and it makes it easier to respond to your post.
Topic archived. No new replies allowed.