C program to perform Addition, Subtraction, Division and Multiplication


Aim :- C program to perform Addition, Subtraction, Division and Multiplication of Two Integers.

C program to perform basic arithmetic operations which are addition, subtraction, division, and multiplication of two numbers. Numbers are integers and will be entered by a user.



C Program Code :



#include <stdio.h>
#include <conio.h>

void main()
{

      int num1, num2, add, subtract, multiply;
      float division;

      clrscr();

      printf("\nEnter Number 1 : ");
      scanf("%d", &num1);
      printf("Enter Number 2 : ");
      scanf("%d",&num2);

      add = num1 + num2;
      subtract = num1 - num2;
      multiply = num1 * num2;
      division = num1 / (float)num2;

      printf("\nAddition : %d\n", add);
      printf("Subtraction : %d\n", subtract);
      printf("Multiplication : %d\n", multiply);
      printf("Division : %.2f\n", division);

      getch();
}


Output :

Post a Comment

0 Comments