-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgramExample.cs
51 lines (39 loc) · 1.23 KB
/
ProgramExample.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1.Dec20
{
class ProgramExample
{
static void Main(string[] args)
{
int[] arr = new int[10];
Console.WriteLine($"Enter {arr.Length} elements ");
for (int i = 0; i < arr.Length; i++)
{
arr[i] = int.Parse(Console.ReadLine());
}
// int[] arr = { 11, 12,13, 14, 15 };
/*for(int i=0;i<arr.Length;i++)
Console.WriteLine(arr[i]);
foreach(int data in arr)
Console.WriteLine(data);
*/
for (int i = arr.Length - 1; i >= 0; i--)
Console.WriteLine(arr[i]);
char[] arr2 = new char[10];
char[] arr3 = { 'a', 'b', 'c', 'e' };
char[] arr4 = new char[] { 'e', 's', 'h', 'a', 'n' };
string[] names = new string[5];
Console.WriteLine("enter 5 names");
for (int i = 0; i < names.Length; i++)
{
names[i] = Console.ReadLine();
}
foreach (string s in names)
Console.WriteLine(s);
}
}
}