Generation

generate functionTue, 02 May 2023

calcule el valor de 1+2+3+4+5 hasta n

int sum(int n) { int total = 0; while (n > 0) { total = total + n; n = n - 1; } return total; }

Questions about programming?Chat with your personal AI assistant