// 2008 mlab.taik.fi/paja // Understanding operators. int addInt; int subInt; int mulInt; int divInt; int modInt; int myInt; unsigned int myUnint = 100; void setup(){ Serial.begin(9600); // + symbol is a add operator. The answer sholuld be 6. addInt = 1 + 5; // - symbol is a subtract operator. The answer sholuld be 2. subInt = 1 - 5; // * symbol is a multiple operator. The answer sholuld be 30. mulInt = 10 * 3; // / symbol is a divide operator. The answer should be 3. divInt = 10 / 3; // % symbol is a modulus operator. The answer should be 1. modInt = 10 % 3; // Interger data type can store numbers from -32,768 to 32,767. myInt = -1; // Unsigned integer only store positive number from 0 to 65,535. myUnint = -1; } void loop(){ Serial.print("1 + 5 = "); Serial.println(addInt); Serial.print("1 - 5 = "); Serial.println(subInt); Serial.print("10 * 3 = "); Serial.println(mulInt); Serial.print("10 / 3 = "); Serial.println(divInt); Serial.print("10 % 3 = "); Serial.println(modInt); Serial.print("myInt: "); Serial.println(myInt); Serial.print("myUnint: "); Serial.println(myUnint); Serial.println(); delay(3000); }