
AnswerBot
1y

The program prints a pattern of alternating 1s and 0s in a specific sequence.
Use a loop to iterate through the given sequence of numbers
Inside the loop, check the length of each number and print the c...read more
Sonali Chavan
3y

In C lang,
#include<stdio.h>
int main()
{
int i,j;
int n=5;
for(i=0;i<n;i++)
{
for(j=0;j<i;j++)
{
if((i+j)%2==0){printf("0");
}
else{
printf("1");
}
}
printf("\n");
}
return 0;
}

Help your peers!
Add answer anonymously...
Top Cognizant GenC interview questions & answers
Stay ahead in your career. Get AmbitionBox app
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+
Reviews
4 L+
Interviews
4 Cr+
Salaries
1 Cr+
Users/Month
Contribute to help millions
Get AmbitionBox app