answersLogoWhite

0


Best Answer

Program to print one & zero Alternatively

#include
#include
void main()
{
int i,j,n,k=1;
clrscr();
printf("Enter the Iteration Value : ");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
{
printf("%d",k);
if(k==1)
k=0;
else
k=1;
}
printf("\t");
}
getch();
}

Output :
Enter the Iteration Value : 5
1 01 010 1010 10101

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
User Avatar

Victory gamer 2021

Lvl 1
2y ago
do you know python

Add your answer:

Earn +20 pts
Q: Write a program to print following series 1 01 010 1010 .?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write a C program to print the following series 112 122 . 1n2?

write a program to print the series 1/12+1/22+.........+1/n2 ?


Write a c program to print the following pyramid 1 121 1231 12321 1234321?

123454321


Write a java program to print the result in the series?

If you have the series stored in an array, you loop through the array and print each array element in turn. Another possibility is to print out the numbers in the series as you generate them. In that case, you may not need to store anything (depending on the series, of course).


Write an assembly language program to print a to z on screen?

write a program to print A to Z on screen in c?


Write a unix program to print print a pattern?

echo 'print a pattern'


Write a java script program to print first ten odd natural numbers in C?

Q.1 Write a program to print first ten odd natural numbers. Q.2 Write a program to input a number. Print their table. Q.3 Write a function to print a factorial value.


Write a program in BASIC to find the sum of the series s equals 2 plus 4 plus . plus 100?

10 print "That is not a question." 20 print "That is a command." 30 end


Write a c program to print roman letters?

good morning


Can you Write a program in 'c' to print symbols of playing cards?

Yes.


Write a program to print the sum of a sparse matrix?

This is a directive, not a question.


Write a program to print following series 100 81 64 49 36 25 16 9 4 1 by using for loop .?

10 rem for next 20 for i=10 to 1 step -1 30 ? I^2; 40 next i 50 end


How do you Write a C program to print a Series of Odd Numbers and Even Numbers.?

Reference:http:cprogramming-bd.com/c_page2.aspx# strange number