Exercise
Sum of two numbers
Objetive
Write a C# program to print the result of adding 12 and 13 on screen.
Example Code
using System; // Importing the System namespace to use Console functionalities
// Main class of the program
public class Program
{
// Main method where the program execution begins
static void Main()
{
// Declaring two integer variables with values 12 and 13
int num1 = 12;
int num2 = 13;
// Calculating the sum of the two numbers
int sum = num1 + num2;
// Printing the result of the sum to the screen
Console.WriteLine("The result of adding 12 and 13 is: " + sum);
}
}