How can I debug this basic IF-ELSE program?
<p>I'm quite new to C coding.</p>

<p>I have written a basic program for calculating interest (the method for calculating simple interest is wrong but that is not where the current problem lies). I'm pasting the code here so that you can have a better grasp of the problem.</p>

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

int main()
{
    printf("This is a program which calculates your balance each year for 5 years! \n");

    char name [30];
    float principal;
    float interestRate;
    int interestType;
    int age;

    printf("Start by entering your name \n");
    scanf("%s", name);

    printf("Please enter the type of interest you earn (Simple = 1, Compound = 2) \n");
    scanf("%d", interestType);

    if (interestType == 1)
    {
        printf("You have chosen your interest type as simple \n");

        printf("Please enter your age \n");
        scanf(" %d", &amp;age);

        // IF statement
        if (age &lt; 18)
        {
            printf("You're not eligible for a bank account yet");
        }
        // ELSEIF statement
        else if (age &gt; 122)
        {
            printf("Please submit your age to the Guinness Book of World Records and try again");
        }
        //ELSE statement
        else
        {
            printf("Please enter your current account balance \n");
            scanf(" %f", &amp;principal);

            //Nested IF statement
            if (principal == 0)
            {
                printf("You don't have any balance, please fill money in your account and try again \n");
            }
            else
            {
                printf("Please enter the rate of interest at which your money is being multiplied \n");
                scanf(" %f", &amp;interestRate);

                // principal *= interestRate is the same as principal = principal * interestRate
                principal = principal + interestRate;
                printf("%s's balance after 1 year will be %f \n", name, principal);

                principal = principal + interestRate;
                printf("%s's balance after 2 years will be %f \n", name, principal);

                principal = principal + interestRate;
                printf("%s's balance after 3 years will be %f \n", name, principal);

                principal = principal + interestRate;
                printf("%s's balance after 4 years will be %f \n", name, principal);

                principal = principal + interestRate;
                printf("%s's balance after 5 years will be %f \n", name, principal);

                printf("Thats all");
            }
        }
    }

    else if (interestType == 2)
    {
        printf("You have chosen your interest type as compound \n");

        printf("Please enter your age \n");
        scanf(" %d", &amp;age);

        // IF statement
        if (age &lt; 18)
        {
            printf("You're not eligible for a bank account yet");
        }
        // ELSEIF statement
        else if (age &gt; 122)
        {
            printf("Please submit your age to the Guinness Book of World Records and try again");
        }
        //ELSE statement
        else
        {
            printf("Please enter your current account balance \n");
            scanf(" %f", &amp;principal);

            //Nested IF statement
            if (principal == 0)
            {
                printf("You don't have any balance, please fill money in your account and try again \n");
            }
            else
            {
                printf("Please enter the rate of interest at which your money is being multiplied \n");
                scanf(" %f", &amp;interestRate);

                // principal *= interestRate is the same as principal = principal * interestRate
                principal *= interestRate;
                printf("%s's balance after 1 year will be %f \n", name, principal);

                principal *= interestRate;
                printf("%s's balance after 2 years will be %f \n", name, principal);

                principal *= interestRate;
                printf("%s's balance after 3 years will be %f \n", name, principal);

                principal *= interestRate;
                printf("%s's balance after 4 years will be %f \n", name, principal);

                principal *= interestRate;
                printf("%s's balance after 5 years will be %f \n", name, principal);

                printf("Thats all");
            }
        }
    }

    return 0;
}
</code></pre>

<p>The problem I am facing is that whenever the program is run and it asks for the type of interest, after taking the input number (1 or 0) it just stops.</p>