X-Git-Url: http://git.piffa.net/web?a=blobdiff_plain;f=programming%2Foperators%2Foperator_2_comparison%2Foperator_2_comparison.ino;fp=programming%2Foperators%2Foperator_2_comparison%2Foperator_2_comparison.ino;h=62243f96a6c91b4f43950ed06137b390e3b8d4b9;hb=e50f2cf8e7402ea56cd01835be9f88c53876bfd1;hp=0000000000000000000000000000000000000000;hpb=f7cdba7df419dcde095f911daa92deb9dcd283ec;p=sketchbook_andrea diff --git a/programming/operators/operator_2_comparison/operator_2_comparison.ino b/programming/operators/operator_2_comparison/operator_2_comparison.ino new file mode 100644 index 0000000..62243f9 --- /dev/null +++ b/programming/operators/operator_2_comparison/operator_2_comparison.ino @@ -0,0 +1,47 @@ +/* + Operatori comparativi binari + Comparison operators, binary + + */ + +int a = 5; +int b = 10; +int c = 20; + +void setup() // run once, when the sketch starts +{ + Serial.begin(9600); // set up Serial library at 9600 bps + + Serial.println("Here is some math: "); + + Serial.print("a = "); + Serial.println(a); + Serial.print("b = "); + Serial.println(b); + Serial.print("c = "); + Serial.println(c); + + Serial.print("a > b = "); // maggiore + Serial.println(a > b); + + Serial.print("a < b = "); // minore + Serial.println(a < c); + + Serial.print("a == b -> "); // stesso valore + Serial.println(a == b); + + Serial.print("a != b -> "); // valore diverso + Serial.println(a != b); + + Serial.print("a <= b ->"); // minore uguale + Serial.println(b <= a); + + Serial.print("a >= b -> "); // maggiore uguale + Serial.println(b >= a); +} + +void loop() // we need this to be here even though its empty +{ +} + +