Hi satabeach,
Please take reference the below code and correct your code.
Code
C#
protected void Page_Load(object sender, EventArgs e)
{
int number = 535;
int divide = 100;
int noOfParts = number / divide;
int remaining = number % divide;
List<int> parts = new List<int>();
for (int i = 1; i < noOfParts; i++)
{
parts.Add(i * divide);
}
parts.Add(remaining + divide);
}
VB.Net
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
Dim number As Integer = 535
Dim divide As Integer = 100
Dim noOfParts As Integer = number / divide
Dim remaining As Integer = number Mod divide
Dim parts As List(Of Integer) = New List(Of Integer)()
For i As Integer = 1 To noOfParts - 1
parts.Add(i * divide)
Next
parts.Add(remaining + divide)
End Sub
Screenshot