Why Open Source

Open Source is not a concept, it's thought process.

Keep Watching this Space

This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

Keep Watching this Space

This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

Blog for open Source lovers

We live in a World of Technology and that tecnoglogy is for All to explore and understand. Period. !!

Showing posts with label Code. Show all posts
Showing posts with label Code. Show all posts

Tuesday, November 22, 2016

How to find Even and Odd Number using Java

Although identifying a number as even or odd it's one of the easiest thing to do. However, just for the sake of knowledge and it's implementation with Java is our prime goal here and hence this post. The logic is simple. Any number which when divided by two leaves no remainder is considered as even and the number which leaves a remainder is odd. This is how we implement it using Java.


This Program is self explanatory and implemented in most easiest way. Please go through it and try implementing with your own logic also. We are using the Scanner java object to ask for user inputs continuously to check if the number is even or odd and until user enters 0 which will break the while loop and program exits.

Monday, November 7, 2016

How to Design Pyramid using Java

As as Beginner in Java Programming field, one try to be creative in playing with for Loops or If Else or While type of conditional statements. And this is where pattern printing programs comes handy. They help us in understanding loops and other java conditional statements in a better way. So more creative you are, more will be your programming skills and there is a good chance to quickly master them. Think of all the wild patterns you want to see and use your programming skills to design them with Java programming. 

One such pattern is Pyramid. It's easy and it really helps in understanding loops and it use on the basic java conditional (for loop) statement. This is what we are planning to print:

And this is how the code will be. Please note there are multiple and many better ways to print the pattern, and this is the basic one:


We have pasted the image of the code and not the exact code because we want you to write the code/program your-self rather then just copy paste. Programming is an art and you will be better at it only when you do it your-self. Still if you want the code to be delivered to your email then please leave your comments below or email at planetopensrc@gmail.com and we will send the code file to you. Also please try to print the pattern using your own code. As we said it earlier, there are many ways to do it better and quicker. So let's try Them.

Cheers !!