Skip to content

Instantly share code, notes, and snippets.

@ellenia
Created December 19, 2016 18:53
Show Gist options
  • Save ellenia/ab3bf0f0d08d8b30f44526f7d96a8e99 to your computer and use it in GitHub Desktop.
Save ellenia/ab3bf0f0d08d8b30f44526f7d96a8e99 to your computer and use it in GitHub Desktop.
namespace AddTwoIntegers
{
class Program
{
static void Main(string[] args)
{
Console.Write("Please enter the first number: ");
int firstNumber = Int32.Parse(Console.ReadLine());
Console.Write("Please enter the second number: ");
int secondNumber = Int32.Parse(Console.ReadLine());
long total = firstNumber + secondNumber;
Console.WriteLine();
Console.WriteLine("Sum of {0} and {1} is {2}", firstNumber, secondNumber, total);
Console.ReadKey();
}
}
}
namespace CSharp
{
class Program
{
static void Main(string[] args)
{
Console.Write("In which year C# 4.0 was released: ");
int releasedYear = Int32.Parse(Console.ReadLine());
Console.Write("Is C# object oriented (true/false): ");
bool isCSharpObjectOriented = Boolean.Parse(Console.ReadLine());
Console.WriteLine();
Console.WriteLine("C# 4.0 Release Year: {0}", releasedYear);
Console.WriteLine("Is C# object oriented: {0}", isCSharpObjectOriented);
Console.ReadKey();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment