sum of two numbers in c#
Let's start on this page we will see how to declare a variable and in c# and after declaring variable well do the sum of 2 numbers.
Step 1- Create an empty project as we do at last blog if you didn't how to create empty console application then plz watch my last blog.
Step 2- write the below code in the main section.which is highlighted with red color.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
int a = 10;
int b = 20;
Console.WriteLine(a + b);
Console.ReadLine();
}
}
}
Let's start on this page we will see how to declare a variable and in c# and after declaring variable well do the sum of 2 numbers.
Step 1- Create an empty project as we do at last blog if you didn't how to create empty console application then plz watch my last blog.
Step 2- write the below code in the main section.which is highlighted with red color.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
int a = 10;
int b = 20;
Console.WriteLine(a + b);
Console.ReadLine();
}
}
}
Output
No comments:
Post a Comment