forked from Gamage98/My-Lab-Work
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
33 lines (31 loc) · 907 Bytes
/
Program.cs
File metadata and controls
33 lines (31 loc) · 907 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Vote
{
class Program
{
private static string name;
static void Main(string[] args)
{
Console.WriteLine("Enter your name : ");
name = Console.ReadLine();
Console.WriteLine("Enter your age :");
int age=int.Parse(Console.ReadLine());
if(age>18)
{
Console.WriteLine(name+", you are eligible for voting");
}
if(age==18)
{
Console.WriteLine(name+",Welcome for voting, this is the first time you vote All the best!");
}
else
{
Console.WriteLine("Sorry "+name+"\nyou are not eligible for voting");
}
Console.ReadKey();
}
}