Answer to Question #243168 in C# for dora

Question #243168

Create a component that receives two numbers from the user through a Web Form, and

based on the user’s selection it adds or subtracts the two numbers and returns the result to

the Web Form. The result should be displayed in the Web Form.


1
Expert's answer
2021-09-29T01:17:31-0400


using System;
class HelloWorld {
  static void Main() {
    Console.WriteLine("Enter first number:");
    int x = Convert.ToInt32(Console.ReadLine());
    Console.WriteLine("Enter second number:");
    int y = Convert.ToInt32(Console.ReadLine());
    int sum = x + y;
    int sub = x-y;
    Console.WriteLine(sum); 
    Console.WriteLine(sub);
  }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS