How do I add continuous calculations to my C # calculator?
For example, I have 2 numbers from the sum of 5, and I want to add 5 in the result already. How can I complete it?
Public class regneoperato: tilfældig {public static void hej () {int number1 = Convert toInt32 (console .readline ()); String repensor = console Readline (); Int number2 = Convert toInt32 (console .readlines ()); Int results = 0; Switch (rennet operator) {case "+": result = number 1 + number 2; break; Case "-": Results = Number 1 - Number 2; break; Case "/": if (number 2 == 0) {Console.WriteLine ("Jig Kana ikke dividere med 0"); } Results = number 1 / number2; break; Case "*": Results = Number 1 * Number 2; break; } Console.light line (result); }}
Just set one of your arguments to the result
var number 1 = Convert. ToInt32 (console .readline ()); Doing {// everything number 1 = results; } While (/ * insert condition * here);
Comments
Post a Comment