PandA-2024.02
main.c
Go to the documentation of this file.
1 
2 extern int plus(int x, int y);
3 extern int minus(int x, int y);
4 extern int times(int x, int y);
5 extern int times2(int x);
6 extern int divide(int x, int y);
7 
8 // computes the expression (2 * (((a - b) + c) * d) - ((e / f) * g)) and
9 // compares it with the value in expected
10 int compute (int a, int b, int c, int d, int e, int f, int g, int expected)
11 {
12  return expected != minus(
13  times2 (
14  times(
15  plus(
16  minus(a, b),
17  c
18  ),
19  d
20  )
21  ),
22  times(
23  divide(e, f),
24  g
25  )
26  );
27 
28 }
int times(int x, int y)
Definition: operations.c:3
int divide(int x, int y)
Definition: operations.c:5
int compute(int a, int b, int c, int d, int e, int f, int g, int expected)
Definition: main.c:10
int plus(int x, int y)
Definition: operations.c:1
int minus(int x, int y)
Definition: operations.c:2
int times2(int x)
Definition: operations.c:4
x
Return the smallest n such that 2^n >= _x.

Generated on Mon Feb 12 2024 13:02:48 for PandA-2024.02 by doxygen 1.8.13