#include <stdio.h>

int main() {
    printf("n\tTriangular Number\n");
    printf("--------------------\n");

    for (int n = 5; n <= 50; n += 5) {
        // Calculate the triangular number using the formula
        int triangularNumberEU = n * (n + 1) / 2;

        // Display the result in the table
        printf("%d\t%d\n", n, triangularNumberEU);
    }

    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: