/* Q. program to produce the following form of Floyd’s Triangle.
0
10
010
1010 */
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,n,a,b;
clrscr();
printf(“Enter No of Line : “);
scanf(“%d”,&n);
for(i=1;i<=n;i++)
{
if(i%2==0)
{ a=0;b=1;}
else
{ a=1;b=0;}
for(j=1;j<=i;j++)
if(j%2==0)
printf(“%d”,a);
else
printf(“%d”,b);
printf(“\n”);
}
getch();
}
Latest posts by Mohit Arora (see all)
- MongoDB Operators Tutorial – What are Different Operators Available? - October 5, 2019
- MongoDB Projection Tutorial : Return Specific Fields From Query - March 9, 2019
- MongoDB Index Tutorial – Create Index & MongoDB Index Types - July 6, 2018