This is my code :
the purpose is to add two big numbers ,First input two numbers in 2 array then swaping both and adding them , Console - Based ,
I'm a newbie in C# so please explain keeping in mind my few knowledge of codes
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Sum_Two_BIG_Numbes
{
public class matrix
{
public int[] c;
public void input(int[] a)
{
for (int i = 0; i < a.Length; i++)
{
a[i] = Convert.ToInt32(Console.ReadLine());
}
}
public void Jamk(int[] a, int[] b, int[] c)
{
for (int i = 0; i < a.Length; i++)
{
int temp = a[i] + b[i];
if ((temp < 10) && (c[i] != 1))
{
c[i] = c[i] + temp;
}
else
{
c[i] = c[i] + temp % 10;
c[i + 1] = c[i + 1] + temp / 10;
}
}
}
public void swap(int[] a)
{
for (int i = 0; i < a.Length; i++)
{
a[i] = a[a.Length - i];
}
}
}
class Program
{
public void Main(string[] args)
{
int[] a = new matrix();
//int[] a = new int[30];
int[] b = new int[30];
int[] c = new int[30];
Console.WriteLine("Enter First Number : ");
matrix.input(a);
Console.ReadLine();
}
}
}
I get this error "An Object Refrence is requiered for the non-static field . . . . ,"