user
Instruction:You are given a code, you need to suggest an improvement for its performance.

Input: int sum = 0; 
for (int i = 0; i < 10; i++) { 
   sum = sum + i; 
}


assistant
The code can be improved by replacing the 'for' loop with the optimized 'while' loop which can have improved performance.