Arduino Programming Language: Int

Name

int

Description

Datatype 'int' occupies two byte(16 bit)and it stores an integer number (number without a decimal point)between 
-32768 to 32767. 
On the Arduino Due datatype 'int' occupies four byte (32bit) and it stores an integer number between -2.147.483.648 to 2.147.483.647

Syntax

int var
int var = value

Parameters

  • var: variable name
  • value: any integer number between -32768 to 32767

Usage

Application

Examples

int a; // It declares an integer variable 'a'

a = -5; // It assigns to 'a' the value -5

int b = 105; // It declares integer variable 'b' and it assigns the value 105

int c = a + b; //It declares a variable 'c' as the sum between other two integer variables


Based on the reference originally written by Arduino Community,  wiring.org.co and  arduino.cc