-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathData_entry_arrays.cs
53 lines (41 loc) · 1.47 KB
/
Data_entry_arrays.cs
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace myprogram
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("how many workers");
int w = Convert.ToInt32(Console.ReadLine());
// initilize multidimentinal array
string[,] record = new string[w, 4];
// Get data from user
for (int i = 0; i < record.GetLength(0); i++)
{
Console.WriteLine("Enter name : ");
record[i, 0] = "Name : "+Console.ReadLine();
Console.WriteLine("Enter contact number : ");
record[i, 1] = "contact : " + Console.ReadLine();
Console.WriteLine("Enter Email : ");
record[i, 2] = "Email : " + Console.ReadLine();
Console.WriteLine("Enter Adress : ");
record[i, 3] = "Adress : " + Console.ReadLine();
Console.WriteLine("");
}
// use for clear console screen
Console.Clear();
// Write data on screen
for (int i = 0; i < record.GetLength(0); i++)
{
for (int j = 0; j < record.GetLength(1); j++)
{
Console.WriteLine(record[i,j]);
}
}
}
}
}