Calculating the Eighth Triangular Number - C Data Type

C examples for Data Type:int

Description

Calculating the Eighth Triangular Number

Demo Code

#include <stdio.h>

int main (void)
{
    int triangularNumber;

    triangularNumber = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8;

    printf ("The eighth triangular number is %i\n", triangularNumber);

    return 0;//w w  w . java2 s  .c o m
}

Result


Related Tutorials