 # Programming Question for LED

Hi guys can i ask some basic coding language. I need to do a mamthematic algorithm here is my coding

``````for(int c=0;c>12c++){
int a = 12+c;
int i=a
Serial.print(a);
``````

the result will be (
12+0=12
12+1=13
12+2=14
12+3=15

What I want is every result of a will be move to the next equation which is:
12+0=12
12+1=13
13+2=15
15+3=18

ahh got the solution just put the I integer to the I function back

got the solution

That's just as well because it was impossible to provide help with the information that you posted. Even the small snippet of code that you posted was invalid and your required output made no sense

Is this for school ?
You have to select a variable and keep on adding the counter to it.
Suppose the resulting variable is called 'result'.
Then you can do: `result = result + counter;`
In the C-language you can do: `result += counter;`

I wanted to combine Wokwi with BigNumber and I used your algorithm to test that Instead of a for-loop, I used the Arduino loop() for the iteration.

This is the Wokwi project: https://wokwi.com/arduino/projects/299615532408111626.
If you click on that link, there is a start-button in the middle-upper of the screen.
If you press the stop-button, then you can scroll up to see the first numbers.

This is the sketch that I used:

``````// Algorithm with BigNumber.
// BigNumber Library:
//   https://github.com/nickgammon/BigNumber
// BigNumber Documentation:
//   http://www.gammon.com.au/forum/?id=11519

// #include <BigNumber.h>  // for normal Arduino code
#include "BigNumber.h"     // for Wokwi simulation

BigNumber result = 12;
BigNumber counter = 0;

void setup()
{
Serial.begin( 115200);
Serial.println( "The sketch has started.");

BigNumber::begin();
BigNumber fact = 1;   // integers only
}

void loop()
{
result += counter;

Serial.print( "counter = ");
Serial.print( counter);
Serial.print( ", result = ");
Serial.println( result);

counter++;
}
``````

Note that when you use a Arduino board, the baudrate of the Serial Monitor has to be set to 115200 as well.

I don't know what the maximum number is. If you let it run for days, then it will run out of memory.