Matrix and Mathematical operations

In C coding , the script is as below ::
#include <stdio.h>
int main()
{
int a[20],i,j,x,sum=0;
printf(“enter a integer number :”);
scanf("%d",&x);
for(i=1;i<=x;i++)
{
sum+=i;
a[i-1]=i;
for(j=0;j<i;j++)
{
printf("%d",a[j]);
if(j!=(i-1))
printf("+");
}
printf("=%d \n",sum);
}
return 0;
}

// How to make it a Dynamic array ?

c_code_01

1 Like