Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

chazog / iax0583

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Commit 62abf84d authored 6 years ago by chazog's avatar chazog
Browse files
Options
  • Browse Files
  • Download
  • Email Patches
  • Plain Diff

Upload New File

parent e93eb5bb master
Hide whitespace changes
Inline Side-by-side
Showing with 82 additions and 0 deletions
  • Lab9/Task1.c
Lab9/Task1.c 0 → 100644
View file @ 62abf84d
#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;
}
This diff is collapsed. Click to expand it.
  • Write
  • Preview
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