Displaying the sum of two numbers input from the keyboard. : Console : Development Class C# Source Code


Custom Search

C# Source Code » Development Class » Console »

 

Displaying the sum of two numbers input from the keyboard.








    


using System;

public class Addition
{
   public static void Main( string[] args )
   {
      int number1; 
      int number2; 
      int sum; 

      Console.Write( "Enter first integer: " ); 
      number1 = Convert.ToInt32( Console.ReadLine() );

      Console.Write( "Enter second integer: " );
      number2 = Convert.ToInt32( Console.ReadLine() );

      sum = number1 + number2;

      Console.WriteLine( "Sum is {0}", sum );
   } 
}


           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Development Class
» Console