File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
beginner_programming/age_counter/Csharp Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 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 \t Count 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 \n Enter Your Birth Month(Eg:7):" ) ;
19+ BirthMonth = Convert . ToInt32 ( Console . ReadLine ( ) ) ;
20+
21+ Console . WriteLine ( "\n Enter The Current Month(Eg:7):" ) ;
22+ CurrentMonth = Convert . ToInt32 ( Console . ReadLine ( ) ) ;
23+
24+ Console . WriteLine ( "\n Enter 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 \t Your Age is {0} Years And {1} Months " , AgeYear , AgeMonth ) ;
31+ }
32+ }
33+ }
You can’t perform that action at this time.
0 commit comments