
make public
main.cpp@0:5f5548003738, 2021-03-26 (annotated)
- Committer:
- BertieHarte
- Date:
- Fri Mar 26 10:20:53 2021 +0000
- Revision:
- 0:5f5548003738
make public
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
BertieHarte | 0:5f5548003738 | 1 | #include "mbed.h" |
BertieHarte | 0:5f5548003738 | 2 | int a = 10; // declare int variable for each of the values from question |
BertieHarte | 0:5f5548003738 | 3 | int b = 20; |
BertieHarte | 0:5f5548003738 | 4 | int c = 30; |
BertieHarte | 0:5f5548003738 | 5 | |
BertieHarte | 0:5f5548003738 | 6 | |
BertieHarte | 0:5f5548003738 | 7 | int main() { |
BertieHarte | 0:5f5548003738 | 8 | int d = (a + b); // perform calculation to get int d. |
BertieHarte | 0:5f5548003738 | 9 | printf("d = %d \n \r", d); // print result of d. |
BertieHarte | 0:5f5548003738 | 10 | int e = (d - c); // perform calculation to get int e. |
BertieHarte | 0:5f5548003738 | 11 | printf("e = %d \n \r", e); // print result of e. |
BertieHarte | 0:5f5548003738 | 12 | } |