Help needed to perform an output in C# console application.
我拥有最高数目
int maxNr = 10;
int myValue = 1;
public void myMethod(){
int choice = int.Parse(Console.ReadLine()); // only 1 or 2 accepted.
//Only choice = 1 in displayed here.
if(choice == 1){
while(myValue <= maxNr){
Console.WriteLine(myValue);
myValue = myValue + 3;
}
}
}
Expected output: 1, 4, 7, 10 Next time the function is called the output should be: 3, 6, 9 2, 5, 8