I was trying to write a program and it seems totally fine but i cannot find the reason why it doesn't work, any help would be thankful : <p>I have created a program which acts as a quiz. It is nowhere near done but I am working on it.</p>

<p>The code is below:</p>

<pre><code>#include &lt;stdio.h&gt;
#include &lt;string.h&gt;
#include &lt;iostream&gt;


int optionOne(int choice, int plonkPoints);
int optionTwo(int choice, int plonkPoints);
int optionThree(int choice, int plonkPoints);
int optionFour(int choice, int plonkPoints);
int optionFive(int choice, int plonkPoints);
int optionOnev2(int choice, int plonkPoints);

int plonkPoints = 0;

void main()
{

    char fName[30];
    char sName[30];
    char rightFname[30] = "Thomas";
    char rightSname[30] = "Sloane";

    char rightFname2[30] = "Ryan";
    char rightSname2[30] = "Gleeson";

    int result;
    printf("This is the Plonker test, it will determine where you are on the scale of Plonkerhood. \nGood luck and don't mess up you twat.\nTo answer yes type 1, to answer no type 0 \n");
    printf("\nFirst what is your first name?: ");
    scanf_s("%s", fName, sizeof fName);

    printf("What is your surname?: ");
    scanf_s("%s", sName, sizeof sName);

    int res1 = strcmp(fName, rightFname);
    int res2 = strcmp(sName, rightSname);

    int res3 = strcmp(fName, rightFname2);
    int res4 = strcmp(sName, rightSname2);

    if (res1 == 0 &amp;&amp; res2 == 0)
        plonkPoints = 528;


    if (res3 == 0 &amp;&amp; res4 == 0)
        plonkPoints = 528;



    int choice;
    printf("\nQuestion 1: Are you a plonker?: ");
    scanf_s("%d", &amp;choice);
    if (choice == 0)
        plonkPoints = plonkPoints + 1;

    if (choice == 1)
        plonkPoints = plonkPoints + 0;

    printf("points: %d\n", plonkPoints);

    while (choice != 0 &amp;&amp; choice != 1)
    {
        printf("That's not a valid answer!\n");
        printf("\nQuestion 1: Are you a plonker: ");
        scanf_s("%d", &amp;choice);
        if (choice == 0)
            plonkPoints = plonkPoints + 1;

        if (choice == 1)
            plonkPoints = plonkPoints + 0;


    }



    printf("\nQuestion 2: What does ORTCEMF stand for?\n");
    printf("1. Only Retards Take Canned Eggs Mother Fucker\n");
    printf("2.\n");
    printf("3.\n");
    printf("4.\n");
    printf("5.\n");
    printf("Enter your answer: ");
    scanf_s("%d", &amp;choice);
    optionOnev2(choice, plonkPoints);
    printf("points = %d", plonkPoints);

}


    int optionOne(int choice, int plonkPoints)
    {
        switch (choice)
        {
        case 1: plonkPoints = plonkPoints + 5;
            break;
        case 2: plonkPoints = plonkPoints + 1;
            break;
        case 3: plonkPoints = plonkPoints + 4;
            break;
        case 4: plonkPoints = plonkPoints + 2;
            break;
        case 5: plonkPoints = plonkPoints + 3;
            break;
        }
        return plonkPoints;
        printf("Plonkpints : %d", plonkPoints);

    }

    int optionTwo(int choice, int plonkPoints)
    {
        switch (choice)
        {
        case 1: plonkPoints = plonkPoints + 1;
            break;
        case 2: plonkPoints = plonkPoints + 5;
            break;
        case 3: plonkPoints = plonkPoints + 2;
            break;
        case 4: plonkPoints = plonkPoints + 4;
            break;
        case 5: plonkPoints = plonkPoints + 3;
            break;
        }
        return plonkPoints;
    }

    int optionThree(int choice, int plonkPoints)
    {
        switch (choice)
        {
        case 1: plonkPoints = plonkPoints + 2;
            break;
        case 2: plonkPoints = plonkPoints + 4;
            break;
        case 3: plonkPoints = plonkPoints + 5;
            break;
        case 4: plonkPoints = plonkPoints + 1;
            break;
        case 5: plonkPoints = plonkPoints + 3;
            break;
        }
        return plonkPoints;
    }

    int optionFour(int choice, int plonkPoints)
    {
        switch (choice)
        {
        case 1: plonkPoints = plonkPoints + 3;
            break;
        case 2: plonkPoints = plonkPoints + 4;
            break;
        case 3: plonkPoints = plonkPoints + 2;
            break;
        case 4: plonkPoints = plonkPoints + 5;
            break;
        case 5: plonkPoints = plonkPoints + 1;
            break;
        }
        return plonkPoints;
    }

    int optionFive(int choice, int plonkPoints)
    {
        switch (choice)
        {
        case 1: plonkPoints = plonkPoints + 4;
            break;
        case 2: plonkPoints = plonkPoints + 1;
            break;
        case 3: plonkPoints = plonkPoints + 2;
            break;
        case 4: plonkPoints = plonkPoints + 3;
            break;
        case 5: plonkPoints = plonkPoints + 5;
            break;
        }
        return plonkPoints;

    }


</code></pre>

<p>I have created five functions. These functions will be used for questions that have 5 options and each option gives you a different amount of points. For example question 2 of the quiz gives 5 points for option one because it is the correct option. I have defined each function and declared them before the main function which seems to be working well. For each of the functions I want the variable choice (the option number which the user chooses) to be the input into the function. It will then work and give the variable "plonkPoints" as the output. In this case when I choose the first option of question two I should then have an extra five points. I even put in a printf to check. For some reason no points are added to the variable "plonkPoints".</p>

<p>I originally had the variable "plonkPoints" as a local variable but then made it a global variable but that did not seem to help.</p>

<p>Any help would be greatly appreciated. Thank you all.</p>
