Read 2 variables, named A and B and make the sum of these two variables, assigning its result to the variable X. Print X as shown below. Print endline after the result otherwise, you will get “Presentation Error”.

Solution
Before seeing the solution make sure that you tried enough. Don’t paste the whole code, just find out the logic
using System;

namespace _1001_Extremely_Basic
{
    class Program
    {
        static void Main(string[] args)
        {
            int A, B, X;
            A = Convert.ToInt32(Console.ReadLine());
            B = Convert.ToInt32(Console.ReadLine());
            X = A + B;
            Console.WriteLine("X = " + X);

            Console.ReadKey();
        }
    }
}

Post a Comment

Previous Post Next Post