- 1

For loop

How do you get the sum of the numbers inside for loop? C# program

6th Oct 2019, 6:30 AM
Beginner_Programmer
Beginner_Programmer - avatar
3 Answers
+ 1
Can you write program in SL Playground and share the link here?
6th Oct 2019, 11:11 AM
A͢J
A͢J - avatar
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.
6th Oct 2019, 10:52 AM
A͢J
A͢J - avatar
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?
6th Oct 2019, 11:05 AM
Beginner_Programmer
Beginner_Programmer - avatar