Skip to content

Commit 76a491d

Browse files
Amine-Smahit2013anurag
authored andcommitted
Add ageCounter program in c# (hacktoberfest17#1185)
1 parent 4999bb7 commit 76a491d

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
using System;
2+
using System.Numerics;
3+
4+
namespace age_counter
5+
{
6+
class Program
7+
{
8+
public static void Main(string[] args)
9+
{
10+
int BirthMonth, BirthYear;
11+
int CurrentMonth, CurrentYear;
12+
int AgeYear, AgeMonth;
13+
14+
Console.WriteLine("\n\n\t\t\tCount the age person\n\n");
15+
Console.WriteLine("Enter Your Birth Year(Eg:1989):");
16+
BirthYear = Convert.ToInt32(Console.ReadLine());
17+
18+
Console.WriteLine("\n\nEnter Your Birth Month(Eg:7):");
19+
BirthMonth = Convert.ToInt32(Console.ReadLine());
20+
21+
Console.WriteLine("\nEnter The Current Month(Eg:7):");
22+
CurrentMonth = Convert.ToInt32(Console.ReadLine());
23+
24+
Console.WriteLine("\nEnter The Current Year(Eg:2010):");
25+
CurrentYear = Convert.ToInt32(Console.ReadLine());
26+
27+
AgeYear=CurrentYear-BirthYear;
28+
AgeMonth=CurrentMonth-BirthMonth;
29+
30+
Console.WriteLine("\n\n\t\tYour Age is {0} Years And {1} Months ",AgeYear,AgeMonth);
31+
}
32+
}
33+
}

0 commit comments

Comments
 (0)