I think you ask about the complexity in terms of number of operations (not the order of magnitude) so I think first is to divide it to small operations and then make the calculation:
int result = 0; // 1 op
int i = 0; // 1op
while (i <= n) { // n op of comparison
result + i; // n op (1 op * n because is inside the loop)
result = [result of operation]; // n op
i + 1 // n op
i = [result of operation]; // n op
}
So you have 5n+2 operations that is O(n) magnitude. Get in mind (as you can see in other questions) that the important thing is normally to get only the order of magnitude.
Also you can have the while divided more in a compassion and a jump. And assignments and declarations can been split.