CCC '19 S5:Triangle: The Data Structure
Welcome to Code Review.

As stated in the comments, the code is the C programming language, not C++. C is a procedural language and C++ is an object oriented lanugage originally based on C. We can tell from the first line,

#include &lt;stdio.h&gt;


In C++ this file would be &lt;cstdio&gt; but generally we would not be using it because represents an older form of input/output that has been replaced in C++.

C++ generally uses 

#include &lt;iostream&gt;


which provides std::cin as input and std::cout as output.

The functions printf() and scanf() generally are not used in C++. FYI scanf() and printf() are not members of the std namespace and std::scanf() does not compile in many compilers.

Complexity
It might be better if there was a function to get the input and another function to process the input. This would lead to less variables being declared in main() and functions that are shorter, easier to read debug and maintain.

Variable Declarations
The line of code:

    unsigned long int e[ne],gval,sum=0;


Is difficult to maintain, it would be better if it was multiple lines.

    unsigned long e[ne];
    unsigned long gval;
    unsigned long sum=0;


Also one should choose either long or int but not both. It would be best if gval was also initialized.

Variables should be declared as needed, for instance the variable gval should be defined inside the first inner for loop as shown below:

Variable Names
Rather than providing comments to explain what the variables are, give the variables meaningful names longer than 2 characters.

This makes the code much easier to read, debug and modify.

Spacing
The vertical and horizontal spacing of the code is all crammed together which makes it very difficult to read add vertical spacing after declarations and after logic blocks.

In expressions there should be spaces around binary operators as shown below.

int main()
{   int n,k;                   //n=height of triangle  k=height of sub-triangles   ne= number of elements
    int t1=0;
    int t2=0;

    scanf("%d %d", &amp;n, k);

    int ne=rec(n);
    int rk=rec(k);
    int nt=ne-rk-1;

    unsigned long e[ne];
    unsigned long sum=0;

    for(int i = 0; i &lt; ne; i++)
    {
        scanf("%ld",&amp;e[i]);
    }

    for(int rt = 0, ior = 0; ior &lt; nt; rt++)
    {
        for(int r=0; r&lt;=rt &amp;&amp; ior&lt;nt; r++,ior++)
        {
            int ioc = 0;
            unsigned long gval = 0;
            for(int ct=0; ioc &lt;rk; ct++)
            {
                for(int c = 0; c &lt;= ct &amp;&amp; ioc &lt; rk; ioc++, c++, t2++)
                {
                    if(gval &lt; e[t2])
                    {
                        gval = e[t2];
                    }
                }
                t2+=rt;
            }
            sum += gval;
            t1++;
            t2 = t1;
        }
    }
    printf("%ld", sum);
    return 0;
}