How is that even compiling, or is it? You are using the "result" variable in your for loop but it is declared after the loop not even in the same scope. Also, you are not assigning your x,y,z,c variables any values when you pass them to the ave() method. Change your code to this:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace The_Average
{
class Program
{
static void Main(string[] args)
{
int resultOfMethodave;
int x,y,z,c;
for (int i = 1; i < 3 ; i++)
{
x = 1;
y = 2;
z = 3;
c = 4;
Console.Write("the student" + i);
Console.WriteLine(":");
for (int j = 1; j < 4; j++)
{
Console.Write("the material of degree" + j);
Console.WriteLine(":");
Console.ReadLine();
Console.WriteLine("The_Average"+result);
}
}
resultOfMethodave = ave(x, y, z ,c);
Console.WriteLine("the result"+result);
Console.ReadKey();
}
static int ave(int x, int y, int z, int c);
{
int result = ((x + y + z + c) / 4);
return result;
}
}
}