/* This program to finds the desired 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;
}


code dog Tucker
E2 logo
Debt AIDS Trade Africa
Valid XHTML 1.0 Transitional