Program to print pentatope numbers upto Nth term | C ++ program to print Pentatope number series . ; Function to print pentatope series up to nth term ; Loop to print pentatope number series ; calculate and print ith pentatope number ; Driver code ; Function call to print pentatope number series
#include <bits/stdc++.h> NEW_LINE using namespace std ; void printSeries ( int n ) { for ( int i = 1 ; i <= n ; i ++ ) { int num = ( i * ( i + 1 ) * ( i + 2 ) * ( i + 3 ) / 24 ) ; cout << num << " ▁ " ; } } int main ( ) { int n = 10 ; printSeries ( n ) ; return 0 ; }