-
Notifications
You must be signed in to change notification settings - Fork 19
/
Errors and Debugging.cs
executable file
·63 lines (56 loc) · 1.72 KB
/
Errors and Debugging.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
60
61
62
63
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Debug
{
class Program
{
//multiplies x and y
static int multiply(int x, int y)
{
int result = x * y;
return result;
}
//divides x by y
static int divide(int x, int y)
{
int result = x / y;
return result;
}
static void check()
{
Console.WriteLine("its working!");
}
static void Main(string[] args)
{
int myintX = 10;
int myintY = 30;
//res = 10 * 30
int result = multiply(myintX, myintY);
//newRes = (300 * 30)/ 10
int newResult = divide(multiply(result, myintY), myintX);
//finaltest = 900 * (300 * 900)
int finalTest = multiply(newResult, multiply(result, newResult));
while(finalTest > 5)
{
check();
Console.WriteLine("The number {0} is quite big, lets drop it a bit", finalTest);
int testInt = 3;
finalTest = divide(finalTest, testInt);
if(finalTest < 600 && finalTest > 5 )
{
Console.WriteLine("THIS IS SILLY");
//other code
}
}
Console.WriteLine("Final Number is: " + finalTest);
//debugging tools for visual studio
//F10 next- move on to the next line
//F11 step in- to a function
//F9 step out
Console.ReadKey();
}
}
}