Announcement:

This is just the beginning of this blog, please don't copy any of my posts.

Sunday 23 December 2012

Define a class having one 3-digit number ,num as data member. Initialize and display reverse of that number.

Define a class having one 3-digit number , num as data member. Initialize and display reverse of that number.

class Prog2

{
public static void main(String args[])
{
  int n=123;
  System.out.println("number is:"+n);
  while(n>0)
  {
    int rem=n%10;
    System.out.print(rem);
   n=n/10;
}
}
}
Share it Please

Pankaj Gaikar

Pankaj Gaikar is a professional blogger from Pune, India who writes on Technology, Android, Gadgets, social media and latest tech updates at Punk Tech , Being Android & Shake The Tech . Email me HERE

0 comments :

Post a Comment

Copyright @ 2013 Pune University Bachelor of Engineering . Designed by Pankaj Gaikar | Love for The Tricks Machine