We are about to switch to a new forum software. Until then we have removed the registration on this forum.
int num =5;
int sumd = sum(num);
println(“The sum of the digits is ” + sumd);
int sum(int n)
{
int ctr;
int sd=0;
if (n <=0)
sd = n;
else
{
for(ctr = 1; ctr <= n; ctr++)
sd += ctr;
}
return (sd);
}
It returns void on line 3 saying unexpected char '\' even though there is no \
Answers
use straight "
your word or wordpress makes them special round ones
I do not understand what you mean by using straight "
your " is a bit curved as it is in Word
use those straight " instead the curved " please both times in line 3.
Just re-type the " in your processing Code.
;-)
Oh ok
Fixed thanks