Tuesday, February 9, 2016

Simple Calculator using C

#include<stdio.h>
int main()
{
int number1, number2;

  printf("Enter number1:");
  scanf("%d",&number1);

  printf("Enter number2:");
  scanf("%d",&number2);

  printf("Addition of two numbers: %d\n", number1 + number2 );
  printf("Substraction of two numbers: %d\n", number1 - number2 );
  printf("Multiplication of two numbers: %d\n", number1 * number2 );
  printf("Division of two numbers: %d\n", number1 / number2 );
return 0;
}

Output of program

Enter number1:10
Enter number2:5
Addition of two numbers: 15
Substraction of two numbers: 5
Multiplication of two numbers: 50
Division of two numbers: 2

No comments:

Post a Comment