Really simple code is getting a wierd error

So im coding using xcode ( i know i know i know, i shouldnt use xcode but i am and i will continue to do so for now ( why? cus i want to and i like it like that) But anyway i have an assignment to write a program that prints the numbers from n to 1 assuming that n is greater than 1. so if n is 5 it should show 5 4 3 2 1-
here is my current code -

#include <iostream>
using namespace std;

int main(int argc, const char * argv[])
int n;

// Get the starting number and initilize n
cout<< "Enter a number that you wish to start the subtraction at \n";

// while n is greater than or equal to 1 subtract one from n ( make the list)
while (n>= 1) {
cout<<n<< " ";

return 0;

yes i am aware that there is now cin.get or system("pause") but thats because im runnng it in xcode right now,
now on the line that reads - while (n>= 1) {- when i run the program and enter the number say 5 instead of printing out 5 4 3 2 1 it prints out (llbd) and that line of code gets highlighted green and says thread 1: breakpoint 1.1 (however there are no breakpoints in my code) can anyone help me! I know its probably a really simple explanation but im new to this and cannot figure it out lol! Thanks!
THe problem is not your code. The problem is in the IDE that you've used or in how you've chosen to run it. Try running the application from the console after building the excecutable and you'll see it work just fine.
I figured it out! I apparently had accidentally enabled a breakpoint that i was not noticing! The program works fine now! Thanks for the help guis!
Topic archived. No new replies allowed.