Programming Examples
Arduino program to input any integer number and print its table
Write a Arduino program to accept a integer number and print its multiplication table.
Solution
int a,i;
void setup()
{
Serial.begin(9600);
}
void loop()
{
if(Serial.available())
{
char c = Serial.read();
String st="";
if (isDigit(c))
{
st=st+c;
a=st.toInt();
for(i=1;i<=10;i++)
{
Serial.println(i*a);
}
}
}
}
Output