You are on page 1of 6

1|P age

Copyright © Manikandan S
http://www.smanikandan.co.nr
2009 Free for Use
2|P age

This document consists of puzzles and programming problems, which I’ve found in the
Internet. The aim of this document is to promote logical thinking and reasoning, which are
the essential components for any application developer. Since, Java is a pure object oriented
language, I thought it would be a good language to start with. The solutions to the
programming problems and puzzles have been included as a separate document. I
recommend you to look at the solutions only after you’ve really tried your hand at solving
these problems. Best of luck. Enjoy Programming.

Cheers,
Manikandan S

Copyright © Manikandan S
http://www.smanikandan.co.nr
2009 Free for Use
3|P age

1. A program to print the following pattern


1
234
56789

2. A program to print the following pattern

1
23
456
7 8 9 10

3. A program to print the following pattern

1
25
368
479

4. A program to print the following pattern

1
01
101
0101
10101
010101
1010101

Copyright © Manikandan S
http://www.smanikandan.co.nr
2009 Free for Use
4|P age

5. A program to print the following pattern

123454321
1234_4321
123___321
12_____21
1_______1

Where the underscore represents space. The output should look like this.

6. A program to print the following pattern


1
12
123
1234
12345

Note: This pattern should be right aligned, in case the formatting is not preserved. A sample
output would look like this.

Copyright © Manikandan S
http://www.smanikandan.co.nr
2009 Free for Use
5|P age

7. A program to print the following pattern

A
BB
CCC
DDDD
EEEEE

8. A program to print the following pattern

Note: This triangle is a common mathematical pattern called “Pascal’s triangle”.


More information at http://en.wikipedia.org/wiki/Pascal_triangle

9. A program to print the following pattern

Note: This pattern represents an equilateral triangle.

Copyright © Manikandan S
http://www.smanikandan.co.nr
2009 Free for Use
6|P age

10. A program to print the following pattern

Copyright © Manikandan S
http://www.smanikandan.co.nr
2009 Free for Use

You might also like