Change
int n1;
To
int n1 = 0;
The compiler is complaining because you didn't give n1 a value before you used it in the while loop. Making it zero (or less) ensures the while loop will run to ask the user
At some point you might want to ask the user for another number. Rather than repeat this code, make a method out of it. Make the method return an int and take a string question to print out so you can vary what you ask. Have the while loop print the question and then read the answer. Consider also using int.TryParse so that if the user enters non numbers it doesn't crash the program
Final point, your question title says "keep asking until the user enters a negative number" but while(n1<=0)
doesn't do this, it does the opposite and will "keep asking while the user enters negative numbers" (i.e. "until the user enters a positive number")