-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
59 lines (46 loc) · 1.42 KB
/
Program.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
54
55
56
57
58
59
using System;
using System.Globalization;
using System.Security.Cryptography.X509Certificates;
namespace ForLoopCriticalThinking
{
class Program
{
static void Main(string[] args)
{
for (int i = 0; i < 5; i++)
{
Console.WriteLine(i);
};
for (int i = 9; i >= 0; i--)
{
Console.WriteLine(i);
}
Console.Write("Enter the word you would like to print out: ");
string word = Console.ReadLine();
Console.Write("Enter the amount of times you would like to print " + word + ": ");
int number = Int32.Parse(Console.ReadLine());
for (int i = 0; i < number; i++)
Console.WriteLine(word);
int numberOfLetters = 0;
foreach (char letter in "Hello World")
{
Console.WriteLine(numberOfLetters++);
}
//string text = "Hello World";
//foreach (char c in text)
//{
// Console.Write(c);
//};
//(i+2)
//int i;
//string str = "Hello World";
//for (i = 0; i < str.Length; i++)
//{
// Console.Write(str[i]);
//};
foreach (char c in "this is a test")
Console.WriteLine(c);
//20 times
}
}
}