Triangular Matchstick Number | C ++ program to find X - th triangular matchstick number ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int numberOfSticks ( int x ) { return ( 3 * x * ( x + 1 ) ) / 2 ; } int main ( ) { cout << numberOfSticks ( 7 ) ; return 0 ; }