/* Platform: Ubuntu 24.04 LTS (WSL on Windows) IDE: nano / VS Code Compiler: gcc */ #include int main(void) { int n, i, value, sum = 0; // Ask user how many numbers printf("How many numbers do you want to add? "); scanf("%d", &n); // Loop to read and add numbers for (i = 1; i <= n; i++) { printf("Enter number %d: ", i); scanf("%d", &value); sum += value; } // Print the result printf("The sum of the %d numbers is %d\n", n, sum); return 0; }