SolveExpression3

This commit is contained in:
2021-04-26 10:47:37 +05:30
parent 376b613e9c
commit 9f7237f90c
3 changed files with 17 additions and 1 deletions

View File

@@ -12,3 +12,4 @@
|10 | BitwiseOperators.c | BitwiseOperators.exe | WAP to perform bitwise operators | |10 | BitwiseOperators.c | BitwiseOperators.exe | WAP to perform bitwise operators |
|11 | LogicalOperator.c | LogicalOperator.exe | WAP for logical operators | |11 | LogicalOperator.c | LogicalOperator.exe | WAP for logical operators |
|12 | SolveExpression2.c | SolveExpression2.exe | WAP to solve given expression "ans=a + b - (c*d) / f + g" | |12 | SolveExpression2.c | SolveExpression2.exe | WAP to solve given expression "ans=a + b - (c*d) / f + g" |
|13 | SolveExpression3.c | SolveExpression3.exe | WAP to solve given expression "ans=a + b - (c*d) / f + g" |

15
SolveExpression3.c Normal file
View File

@@ -0,0 +1,15 @@
// WAP to solve given expression.
// ans = a / (a+b) - [ d * e / (f*g)]
void main() {
int a, b, e, d, f, g, ans;
printf("Enter the value of a & b\n");
scanf("%d,%d", &a, &b);
printf("\nEnter the value of e & d\n");
scanf("%d,%d", &e, &d);
printf("\nEnter the value of f & g\n");
scanf("%d,%d", &f, &g);
ans == a / (a+b) - (d * e / (f*g));
printf("\n The answer to a / (a+b) - [ d * e / (f*g)] = %d", ans);
}

BIN
SolveExpression3.exe Normal file

Binary file not shown.