Solve Expressions 2

This commit is contained in:
2021-04-25 16:40:26 +05:30
parent b190456845
commit 376b613e9c
3 changed files with 22 additions and 1 deletions

20
SolveExpressions2.c Normal file
View File

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