Search This Blog

This website completely moved to new domain. For latest content, visit www.programmingposts.com

C# PROGRAM TO ADD TWO INTEGERS WITHOUT USING THIRD VARIABLE



C# Program To Add Two Numbers/Integers without using Third Variable :

using System;
 
namespace CsharpPrograms
{
    class Program
    {
        static void Main(string[] args)
        {
 
            int x,y;
            Console.WriteLine(">>> PROGRAM TO ADD TWO NUMBERS WITHOUT USING THIRD VARIABLE <<< ");
            Console.Write("\n Enter the first number to be added: ");
            x=Convert.ToInt32(Console.ReadLine());         // taking x value from keyboard
            Console.Write("\n Enter the second number to be added: ");
            y = Convert.ToInt32(Console.ReadLine());         // taking y value from keyboard
            x = x + y;     /*assining the value of sum of x and y to x*/
 
          Console.WriteLine("\n The sum of two numbers is: "+x);    /*printing the sum.*/
          Console.ReadLine();
        }
    }
}

Output:



..For C Program : c program to add two numbers without using third variable

9 comments:

  1. A awesome information thanks for sharing.
    C# Training
    c sharp training in chennai

    ReplyDelete
  2. The knowledge of technology you have been sharing thorough this post is very much helpful to develop new idea. here by i also want to share this.
    Best Devops online Training
    Online DevOps Certification Course - Gangboard

    ReplyDelete
  3. The post is written in very a good manner and it entails many useful information for me. I am happy to find your distinguished way of writing the post. Now you make it easy for me to understand and implement the concept.
    Selenium training in Chennai
    Selenium training in Bangalore
    Selenium training in Pune
    Selenium Online training

    ReplyDelete
  4. I have been meaning to write something like this on my website and you have given me an idea. Cheers.
    python Course in Pune
    python Course institute in Chennai
    python Training institute in Bangalore

    ReplyDelete

  5. I am looking for and I love to post a comment Python classes in punethat "The content of your post is awesome" Great work!

    ReplyDelete