Q:

Dividing two numbers

I'm doing some self-education in C#, and although I did more complex projects than this, I can't figure out what the problem is.
    private void button4_Click(object sender, EventArgs e)
    {
        int headcount = 0;
        int input = Global.inputcount;

        for (int i = 0; i < Global.inputcount; i++)
        {
            if (Global.myTextFile[i] == "F")
            {
                headcount++;
            }
        }
        float result;
        result = headcount/input; <<< that line
        button4.Text = result.ToString();
    }

This is my code, its supposed to count how many times does F occour in the myTextFile array, and it should divide that number with the number of inputs.
I debugged it many times, and everything is fine until [that] line. Result is 0 despite the fact that (headcount = ~2201) and (input = ~4321).
I used to work with pascal, I've been using C# for like 2 months so if anyone can help me out i would be grateful.
F stands for "Fej" = "Head" in Hungarian

A:

int / int performs integer division which always disregards fractional part no matter which type you assign it.
From / Operator (C# Reference)

When you divide two integers, the result is always an integer. For
  example, the result of 7 / 3 is 2. To obtain a quotient as a rational
  number or fraction, give the dividend or divisor type float or type
  double.

You might wanna use floating-point division instead.
result = (float)headcount / input;

or
result = headcount / (float)input;

Check 7.7.2 Division operator documentation as well.

