29-12-18, 04:38 AM
السلام عليكم
ممكن مساعدة بسيطة يا اصدقاء
اريد عند كتابة رقم واحد في console يقوم بهذا الامر
و اذا ادخلت رقم 2 يقوم بهذا الامر
ممكن مساعدة بسيطة يا اصدقاء
اريد عند كتابة رقم واحد في console يقوم بهذا الامر
كود :
Console.WriteLine("Type a number and press Enter")
num1 = Console.ReadLine()
Console.WriteLine("Type another number to add to it and press Enter")
num2 = Console.ReadLine()
answer = num1 + num2
Console.WriteLine("The answer is " & answer)
Console.ReadLine()
كود :
Console.WriteLine("Type a number and press Enter")
num1 = Console.ReadLine()
Console.WriteLine("Type another number to add to it and press Enter")
num2 = Console.ReadLine()
answer = num1 - num2
Console.WriteLine("The answer is " & answer)
Console.ReadLine()