Search This Blog

Showing posts with label java programs sunny miglani blog fails Why are you reading this? reddit minecraft. Show all posts
Showing posts with label java programs sunny miglani blog fails Why are you reading this? reddit minecraft. Show all posts

Thursday, 16 February 2012

Java Programs (Printing out ASCII Codes of letters)


class asciiCodes
    {
        public static void main()
        {
            char i;
            char j;
            for(i='a';i<='z';i++)
        {
            System.out.println(i+"       "+(int)i); // The (int) part converts letters to asciiCode
        }
    }
}

Wednesday, 15 February 2012

Program Java Even or Odd


class evenOdd
    {
        public static void main(int no)
        {
           if(no%2==0) // Modulus (dunno how to spell it) find the remainder.. If its an even                              {                                                                                  //number the thing is 0

               System.out.println("Even number");
            }
            else
            {
              System.out.println("Not an even number");
            }
        }
    }

Java Programs

Well, I've been gone for a LONG TIME.... You probably dont care..
Anyway i learnt Java and will be posting some small... tiny.. freaking easy programs...