- 1
For loop
How do you get the sum of the numbers inside for loop? C# program
3 Answers
+ 1
Can you write program in SL Playground and share the link here?
0
Did you try by yourself? If no then first try to do by yourself because you are here to learn coding. If yes then what problem you are facing. Tell here.
0
for (i = 1; i<= 10; i++)
Console.Write (n);
console.Write (n+n+n+n...+n); -- i write +n 10 times and got 110 as the answer which is wrong.
then i wrote it 5 times (n+n+n+n+n) and got the correct answer not really understanding how it happened i just accidentally got it.
may i know the right way to solve this?