473,386 Members | 1,786 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

print 10101 and 01010 series using for loop

10101
01010
10101
01010
i want print above series using for loop.
Apr 11 '14 #1
2 1691
weaknessforcats
9,208 Expert Mod 8TB
Can you write a for loop that cycles 4 times?

If you look vertically you will see each columns changes from 1 to 0 or 0 to 1.

Define four bools.

Change the state of these bools on each cycle of the loop.

Post again after you have a little code.
Apr 11 '14 #2
techboy
28
I think he is need of pattern code i.e using only two for loops and which is the better approach.
Understand the pattern as a i*j matrix such that
when i = even print the even j values as '1' and
when j = odd print the odd j values as '1'
else where print '0'.
Apr 14 '14 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: srivalli chavali via DotNetMonster.com | last post by:
Hi, I have to print a word document using C#.NET. I also have to customize the printing option, the Printer tray, programmatically. So, I have used the PrintDocument class available in C#....
3
by: greek | last post by:
Hi! I hav to generate fibonaaci series using recursion: 0,1,1,2,3,5,8,18,21... whr fibonacci(0)=0 fibonacci(1)=1 fibonacci(n)=fibonacci(n-1)+fibonacci(n-2) ive witten the code but having 2...
2
by: guneet bhatia | last post by:
please help with fibonacci series using recursion..
2
by: rajeshsuri | last post by:
hi this is rajesh please send program for fibonacci series using pointers or functions
1
by: vaisali | last post by:
fibonnaci series using reccursion pls give me d code in C
2
by: cheetahhonda991 | last post by:
I want to write a c program to print sum of series of numbers. Can anyone please send me the program code.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.