mirror of
https://github.com/mytechnotalent/Embedded-Hacking.git
synced 2026-08-12 06:00:24 +02:00
added chapter 26, 27 and 28
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
#include <stdio.h>
|
||||
#include "pico/stdlib.h"
|
||||
#include "pico/cyw43_arch.h"
|
||||
|
||||
int main(void)
|
||||
{
|
||||
stdio_init_all();
|
||||
|
||||
int x = 5;
|
||||
int y = 10;
|
||||
int arithmetic_operator = (x * y);
|
||||
int increment_operator = x++;
|
||||
bool relational_operator = (x > y);
|
||||
bool logical_operator = (x > y) && (y > x);
|
||||
int bitwise_operator = (x<<1); // x is now 6 because of x++ or 0b00000110 and (x<<1) is 0b00001100 or 12
|
||||
int assignment_operator = (x += 5);
|
||||
|
||||
while (true)
|
||||
{
|
||||
printf("arithmetic_operator: %d\r\n", arithmetic_operator);
|
||||
printf("increment_operator: %d\r\n", increment_operator);
|
||||
printf("relational_operator: %d\r\n", relational_operator);
|
||||
printf("logical_operator: %d\r\n", logical_operator);
|
||||
printf("bitwise_operator: %d\r\n", bitwise_operator);
|
||||
printf("assignment_operator: %d\r\n", assignment_operator);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user