add Chapter01 examples
This commit is contained in:
10
Chapter01/compile_time_const.c
Normal file
10
Chapter01/compile_time_const.c
Normal file
@@ -0,0 +1,10 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#define VOLTAGE 3300
|
||||
#define CURRENT 1000
|
||||
|
||||
int main() {
|
||||
const float resistance = VOLTAGE / CURRENT;
|
||||
printf("resistance = %.2f\r\n", resistance);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user