Simple calculator in C V2 My last question had a lot of views (over a 1000) so I decided to apply what I learned from the previous question and revamp the program. I learnt a lot from posting that question (functions, how to do a menu without using using a lot of printf and learning to not repeat code etc). So here's the updated program:

#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;

//Function prototype
void getData(int *,int *);
int addition(int,int);
int subtraction(int,int);
int multiplication(int,int);
int division(int,int);

//Main function
int main()
{
    do//Infinite do - While loop
    {
        int num1,num2,choice;

        printf("\nEnter a number from the list below\n\n"
               "\t1. Addition\n"
               "\t2. Subtraction\n"
               "\t3. Multiplication\n"
               "\t4. Division\n"
               "\t0. Quit program\n");

        printf("\nEnter number: ");
        scanf("%d",&amp;choice);

        if (choice == 0)
        {
            puts("\nExiting program...");
            exit(0);
        }
        else
        {
            getData(&amp;num1,&amp;num2);//Get values for user input

            if(choice == 1)
            {
                printf("\n%d + %d = %d\n",num1,num2,addition(num1,num2));//Output addition
            }
            else if(choice == 2)
            {
                printf("\n%d - %d = %d\n",num1,num2,subtraction(num1,num2));//Output subtraction
            }
            else if(choice == 3)
            {
                printf("\n%d * %d = %d\n",num1,num2,multiplication(num1,num2));//Output multiplication
            }
            else if(choice == 4)
            {
                if(num2 == 0)
                {
                    printf("\nError! Division by zero! Exiting program\n");
                    exit(1);
                }
                else
                {
                    printf("\n%d / %d = %d\n",num1,num2,division(num1,num2));//Output division
                }
            }
            else
            {
                printf("Enter correct number! Exiting program");
                exit(1);
            }
        }
    }while(1);
}

//Get memory address of num1, num2 and store values in this location
void getData(int *num1_ptr,int *num2_ptr)
{
  printf("\nEnter first number: ");
  scanf("%d",num1_ptr);

  printf("\nEnter second number: ");
  scanf("%d",num2_ptr);
}

//Addition
int addition(num1,num2)
{
    return num1 + num2;
}

//Subtraction
int subtraction(int num1,int num2)
{
    return num1 - num2;
}

//Multiplication
int multiplication(int num1,int num2)
{
    return num1 * num2;
}

//Division
int division(int num1,int num2)
{
    return num1 / num2;
}
//End of code
Other reviews already provided some pretty good points, so I'll just mention a few other things and reiterate on some already mentioned ones.


I would advise against function prototypes in this case. Since this is a single source file program, you could declare all functions before main() and avoid the prototypes. The problem with function prototypes is code duplication. If you change one function, at least two updates are mandatory, instead of just one. Avoid this extra maintenance overhead if you can.
For decimal division to work properly, you'll need a to use a floating-point type. My suggestion would be to use double instead of float. The float type is only recommended for storage and memory saving. Most CPUs operate natively on doubles and will convert a float to double when operating on a value. Since you don't have storage constraints, double is the best option.
Don't write noisy and obvious comments. The overall rule about code commenting is to use them to explain why you solved a problem in a given way, or to give any extra information (web links, mathematical formulas, etc) that will aid the understanding of a piece of code. Explaining what a code is doing should not be necessary if the code is well written. Well written code is self explanatory.
Arguably personal preference, but I find it better to properly space expressions and parameter list in function calls.


printf("\n%d + %d = %d\n",num1,num2,addition(num1,num2));



Better spacing:

printf("\n%d + %d = %d\n", num1, num2, addition(num1, num2));