Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Older___younger_or_same_age
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.Write("age of the first: ");
- int FirstAge = Int32.Parse(Console.ReadLine());
- Console.Write("name of the first: ");
- string FirstName = Console.ReadLine();
- Console.Write("age of the second: ");
- int SecondAge = Int32.Parse(Console.ReadLine());
- Console.Write("name of the second: ");
- string SecondName = Console.ReadLine();
- if (FirstAge == SecondAge)
- {
- Console.WriteLine("{0} is the same age as {1}", FirstName, SecondName);
- }
- else
- {
- if (FirstAge > SecondAge)
- {
- Console.WriteLine("{0} is older than {1}", FirstName, SecondName);
- }
- else
- {
- Console.WriteLine("{0} is younger than {1}", FirstName, SecondName);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment