Commit 62abf84d by chazog

Upload New File

parent e93eb5bb
Showing with 82 additions and 0 deletions
#include <stdio.h>
#include <math.h>
int add(int m, int n);
int subtraction(int m, int n);
int multiplication(int m, int n);
float division(float m, float n);
int main()
{
int m, n;
int sum;
int subtract;
int multiply;
float divide;
int op;
printf("Enter the values of m & n: ");
scanf("%d %d", &m, &n);
printf("1.Addition\n2.subtraction\n3.multiplication\n4.division\n");
printf("Enter your Choice : ");
scanf("%d", &op);
switch (op)
{
case 1:
sum = add(m, n);
printf("%d", sum);
break;
case 2:
subtract = subtraction(m, n);
printf("%d", subtract);
break;
case 3:
multiply = subtraction(m, n);
printf("%d", multiply);
break;
case 4:
divide = division(m, n);
printf("%f", divide);
break;
default:
printf(" Enter Your Correct Choice.");
break;
}
return 0;
}
int add(int m, int n)
{
int output;
output = m + n;
return output;
}
int subtraction(int m, int n)
{
int output;
output = m - n;
return output;
}
int multiplication(int m, int n)
{
int output;
output = m * n;
return output;
}
float division(float m, float n)
{
float output;
output = m / n;
return output;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment