Addition of Two Numbers in C# Using Class

Addition of Two Numbers in C# Using Class. In this program we can print the addition of two numbers using C sharp. the result of adding two or more numbers or terms. “Addition” is defined as “the act of adding something to something else”, such as adding a baby to your family or adding numbers to get the sum in math class, for example.

using System;

namespace Main
class Program
static void Main(string[] args)
int x = 10;
int y = 10;
Console.WriteLine(x + y);




Arithmetic Operator in C#

Calculated with two operands, an arithmetic operator is an algebraic function. As a result, most computer languages have a set of operators that can be used in equations to perform a variety of sequential calculations.

Console in C# Program

Console is a predefined class in the System namespace that is used to display information. Write() and WriteLine() are both methods of the Console Class. Because of this, the Write() and WriteLine() functions are identical except for the console. Instead of printing a new line, Write is used to output data.

In other words, a console is an operating system window that allows a user to communicate with the operating system, or an application that allows us to input text from the keyboard and receive it as output from the computer.