This: while(a = 1 && b = 1)
would just set a and b to one and cause an endless loop.
This: a+b=c;// or 2
wouldn´t compile... and make me wonder if you ever wrote a code completely on your own.
This is how it should be:
function add()
{
while(a == 1 && b == 1)
{
c = a+b;
}
}
Also have a look at the position of the bracket closing the loop...
It doesn´t really matter, but especially in a tutorial you should write clean code.
Other than that it would make much more sense to create something which is somehow usable, and to test everything...