I am currently a complete beginner to C# however I am having this issue and as a python user the error doesn't make any sense to me. I have tried to find a fix but I don't know what to search for or how to describe the error, so please help!
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace testin
{
class Program
{
static void Main(string[] args)
{
PrintState();
CalculateAge();
EzMaths();
//Here I call the procedure which is declared later on
Console.ReadLine();
}
static void PrintState()
{
/*Here I write the procedure of 'PrintState',
* or print statement. The program will print "hey world"
* to the console as a result. */
Console.WriteLine("Hey world");
}
static void EzMaths()
{
Console.WriteLine("Enter the first number ");
Console.Write("> ");
int num1 = Console.Read();
Console.WriteLine("Enter the second number ");
Console.Write("> ");
int num2 = Console.Read();
int total = (num1 + num2);
Console.WriteLine(total);
}
static void CalculateAge()
{
Console.WriteLine("Enter your year of birth ");
Console.Write("> ");
int date = Console.Read();
int age = (2018 - date);
Console.Write("You are " + (age));
Console.ReadLine();
}
}
}