Please note, this is a STATIC archive of website www.w3resource.com from 19 Jul 2022, cach3.com does not collect or store any user information, there is no "phishing" involved.
w3resource

C# Sharp Exercises: Print the sum of two numbers


C# Sharp Basic: Exercise-2 with Solution

Write a C# Sharp program to print the sum of two numbers.

In mathematics, summation (capital Greek sigma symbol: ∑) is the addition of a sequence of numbers; the result is their sum or total. The numbers to be summed may be integers, rational numbers, real numbers, or complex numbers.

C# sharp Exercises: Print the sum of two numbers

Sample Solution:

C# Sharp Code:

public class Exercise2
{
    public static void Main()
    {
        System.Console.WriteLine(15+17);
    }
}

Sample Output:

32 

Flowchart:

Flowchart: C# Sharp Exercises - Print the sum of two numbers

C# Sharp Code Editor:

Improve this sample solution and post your code through Disqus

Previous: Write a C# Sharp program to print Hello and your name in a separate line.
Next: Write a C# Sharp program to print the result of dividing two numbers.

What is the difficulty level of this exercise?

Test your Programming skills with w3resource's quiz.