Hi,
I'm very new to Xcode and I'm just learning C++ . In a command line project, I'm having this issue where Xcode won't run my program past cout. I know the code is right, and i don't get any errors. When it asks me to enter a value, I do, and nothing happens. also, the program won't stop until I stop it. What should I do? I would really appreciate any help, because I haven't been able to find the answer online or in the xcode help!
here's the code
#include <iostream>
int main()
{
using namespace std;
cout << "Enter a number: ";
int nValue;
cin >> nValue;
if (nValue > 10 && nValue < 20)
cout << "Your value is between 10 and 20" << endl;
else
cout << "You value is not between 10 and 20" << endl;
return 0;
}
I'm very new to Xcode and I'm just learning C++ . In a command line project, I'm having this issue where Xcode won't run my program past cout. I know the code is right, and i don't get any errors. When it asks me to enter a value, I do, and nothing happens. also, the program won't stop until I stop it. What should I do? I would really appreciate any help, because I haven't been able to find the answer online or in the xcode help!
here's the code
#include <iostream>
int main()
{
using namespace std;
cout << "Enter a number: ";
int nValue;
cin >> nValue;
if (nValue > 10 && nValue < 20)
cout << "Your value is between 10 and 20" << endl;
else
cout << "You value is not between 10 and 20" << endl;
return 0;
}