C# Program to print the sum of two numbers


This content was proof-read by Grammarly. You can Try Grammary for FREE

Problem

Write a program in C# to add two numbers and display the result in copnsole window.

How to print the sum of two numbers in C# ?

using System;

namespace AbundantcodeApp
{
    class Program
    {
        static void Main(string[] args)
        {
            int input1 = 10;
            int input2 = 25;
            int result = input1 + input2;
            Console.WriteLine("Abundantcode.com coding sample");
            Console.WriteLine(result);
            Console.ReadLine();
        }
    }
}

Output

Abundantcode.com coding sample

35

Newsletter Signup

Subscribe to our weekly newsletter below and never miss the latest product or an exclusive offer.

Newsletter Signup

Subscribe to our weekly newsletter below and never miss the latest product or an exclusive offer.

%d bloggers like this: