/* a humble program to find the nth triangular number */
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n = 0;
int i;
printf("\nEnter a number to get that nth triangular number: ");
scanf("%d", &i);
n = ((i * (i + 1)) / 2);
printf("\nTriangular number %d is %d.\n\n", i, n);
system("PAUSE");
return 0;
}