Calculate gcd of two numbers
The code does not account for negative numbers, yet the number type (int) allows them. The program will print 1 for the input -15 10, although 5 is the correct answer.
The GCD is usually positive, but your program will print -10 on the input -10 10.
A function int gcd(int, int) will make it easier to test and re-use.
Since you provided a complete program you probably want to check whether the user actually inputs two numbers and not tree 0.1234 or something else that's not an int.


That being said, thank you for


not using namespace std;
properly indenting your code (you could add braces around the if, though)
using proper names where they were reasonable (n1 and n2 aren't long-lived enough)


I guess that you know that there are better algorithms, so for a simple algorithm like this there is not much to improve. You certainly have to consider negative numbers, though. 

Also, some variables are available for the whole scope (n1 and n2), but only used for a short time. Try to limit the scope of a variable as much as possible, as it prevents errors like

for(i = 2; i &lt;= n1 / 2; ++i) // should have been "smaller", whoops