You won't learn anything until you start to mess with these things yourself. All it takes is a bit of effort to do your homework. It took me 5 minutes to do this, you can probably write better code than this too:
#include <stdio.h>
int main()
{
int n=0, i,j;
for (i=1; i<5; i++)
{
for (j=i; j>0; j--)
{
printf("%u ", n);
n++;
}
if (n == 6)
puts("and");
else
putchar('\n');
}
n=0;
for (i=0; i<5; i++)
{
n += i;
for (j=1; j<=i; j++)
{
printf("%u ", n-j);
}
putchar('\n');
}
return 0;
}