Created
December 19, 2016 18:53
-
-
Save ellenia/ab3bf0f0d08d8b30f44526f7d96a8e99 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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