Ok I didn't quite get that, but I modified the code to this:
Code:
#include <stdio.h>
int main (int argc, char **argv) {
int sum = 0; //Final sum
int k = 1;
int i;
// int l;
// int m;
printf ("Please enter integer number which is at least 1 or at most 20 : \n");
scanf ("%d", &k);
k = i;
while (i >= 1 ){
sum = i + 1;
printf ("The sum is : %d \n", sum);
}
return (0);
}
So basically I initialized sum = 0 right at the beginning and didn't put it in the loop. And also set the printf within the loop.
But what this does now is say; "The sum is : 23992392924" And it continuously prints this at like 10 lines a second forever. And I have to close cmd as a result