
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 GenC Interview Questions Asked at Cognizant
Q. How willing are you to adapt to new technologies?
Q. What is the difference between delete and truncate?
Q. What is the self keyword in Python?
Top Skill-Based Questions for Cognizant GenC
C++ Interview Questions and Answers
300 Questions
Data Structures Interview Questions and Answers
250 Questions
Algorithms Interview Questions and Answers
250 Questions
Java Interview Questions and Answers
250 Questions
Python Interview Questions and Answers
200 Questions
C Interview Questions and Answers
100 Questions
Stay ahead in your career. Get AmbitionBox app


Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+
Reviews
10L+
Interviews
4 Cr+
Salaries
1.5 Cr+
Users
Contribute to help millions
AmbitionBox Awards
Get AmbitionBox app

