How to calculate sum of n integers and print the value of n | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to calculate sum of n integers and print the value of n

C# using windows form

3rd Oct 2020, 4:02 PM
Siyasamkela Lumbo
Siyasamkela Lumbo - avatar
2 Answers
+ 6
Take one variable sum and initialize it with 0 and take one more variable for number of Integer n you for loop and give condition upto total Number for(i=0;i<number of Integer;i++) { sum+=i; }
3rd Oct 2020, 4:23 PM
A S Raghuvanshi
A S Raghuvanshi - avatar
+ 3
Please show us your attempt first. What is the part you find difficult to do ?
3rd Oct 2020, 4:14 PM
sneeze
sneeze - avatar