/*
1
0 1
1 0 1
0 1 0 1
1 0 1 0 1
*/
#include <iostream.h>
#include <conio.h>
void main()
{
int ele = 1;
int h, i, j;
cout<<"\n Enter Height :";
cin>>h;
for(i=1; i<=h; i++)
{for(j=1;j<=i;j++)
{
cout<
if(ele == 0)
ele = 1;
else
ele = 0;
}
cout<<"\n";
}
getch();
}
No comments:
Post a Comment