FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Examples/Example1/Example2/Program.cs at master · TheGer/Examples · GitHub
TheGer
/
Examples
Public
Notifications
You must be signed in to change notification settings
Fork
2
Star
2
Code
Issues
0
Pull requests
1
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Examples
/
Example1
/
Example2
/
Program.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
94 lines (69 loc) · 2.07 KB
Breadcrumbs
Examples
/
Example1
/
Example2
/
Program.cs
Copy path
File metadata and controls
94 lines (69 loc) · 2.07 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
using
System
;
using
System
.
Collections
.
Generic
;
using
System
.
Linq
;
using
System
.
Text
;
using
System
.
Threading
.
Tasks
;
namespace
Example2
{
class
TheProgram
{
static
void
Main
(
string
[
]
args
)
{
//this is an example of different loops
int
countDown
=
5
;
//check if you can continue at the beginning
//this loop can happen 0 or more times
while
(
countDown
>
0
)
{
Console
.
WriteLine
(
countDown
)
;
countDown
--
;
}
//this can happen 1 or more times
countDown
=
5
;
do
{
Console
.
WriteLine
(
countDown
)
;
countDown
--
;
}
while
(
countDown
>
0
)
;
//the famous for loop
for
(
int
count
=
5
;
count
>
0
;
count
--
)
{
Console
.
WriteLine
(
count
)
;
}
int
[
]
myNumbers
=
{
6
,
2
,
1
,
8
,
9
}
;
//myNumbers[0] = 6
foreach
(
int
num
in
myNumbers
)
{
Console
.
WriteLine
(
num
)
;
}
string
[
]
daysOfWeek
=
{
"Monday"
,
"Tuesday"
,
"Thursday"
}
;
foreach
(
string
dayOfLesson
in
daysOfWeek
)
{
Console
.
WriteLine
(
dayOfLesson
)
;
}
for
(
int
count1
=
0
;
count1
<
5
;
count1
++
)
{
for
(
int
count2
=
0
;
count2
<=
count1
;
count2
++
)
{
Console
.
Write
(
"X"
)
;
}
Console
.
WriteLine
(
)
;
}
int
[
]
junkNumbers
=
{
5
,
6
,
32
,
3
,
1
}
;
foreach
(
int
n
in
junkNumbers
)
{
Console
.
WriteLine
(
n
)
;
}
int
[
]
myArrayOfNumbers
=
new
int
[
5
]
;
//small to big
Array
.
Sort
(
junkNumbers
)
;
//big to small
Array
.
Reverse
(
junkNumbers
)
;
foreach
(
int
n
in
junkNumbers
)
{
Console
.
WriteLine
(
n
)
;
}
Console
.
ReadLine
(
)
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL