#include <stdio.h>
#include <stdlib.h>
#include <conio.h>

int main()
{
    int i=0,sum=0;

    while(!kbhit()) {
        printf("%d\n",i);
        i++;
        sum = sum + i;

    }

    printf("Sum : %d\n",sum);

    system("PAUSE");
    return 0;
}
