Solve Expressions 2
This commit is contained in:
20
SolveExpressions2.c
Normal file
20
SolveExpressions2.c
Normal 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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user