First analysis the pattern,
void main()
{
int r,c,s,n=4,v=1;
clrscr();
for(r=1;r<=n;r++)
{
for(s=1;s<=n-r;s++)
{
printf(" ");
}
for(c=1;c<=(r*2)-1;c++)
{
printf("%d",v);
v=!v; // NOT Operation on v
// Inverse the value of v
}
printf("\n");
v=1;
}
getch();
}