wap: palindrome

import java.io.*; public class Palindrome { public static void main(String [] args){ try{ BufferedReader object = new BufferedReader( new InputStreamReader(System.in)); System.out.println("Enter number"); int num= Integer.parseInt(object.readLine()); int n = num; int rev=0; System.out.println("Number: "); System.out.println(" "+ num); for (int i=0; i<=num; i++){ int r=num%10; num=num/10; rev=rev*10+r; i=0; } System.out.println("After reversing the number: "+ " "); System.out.println(" "+ rev); if(n == rev){ System.out.print("Number is palindrome!"); } else{ System.out.println("Number is not palindrome!"); } } catch(Exception e){ System.out.println("Out of range!"); } } }

........................................................................... wap : fibonacci series.

import java.io.*; import java.util.*; public class Fibonacci { public static void main(String[] args) throws Exception { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)) ; System.out.print("Enter value of n: "); String st = reader.readLine(); int num = Integer.parseInt(st); int f1=0,f2=0,f3=1; for(int i=1;i<=num;i++){ System.out.println(f3); f1=f2;

.....println("not an armstrong no. is an armstrong no.c.....parseInt(br....... BufferedReader br=new BufferedReader(new InputStreamReader(System..... } if(s==n) System....out.println("enter a number").....in))...s=0.. else System. while(n>0){ d=n%10...... f3=f1+f2.......readLine())...... int n=Integer.......io...").")... }} .*....... } } } . class arms{ public static void main(String args[])throws IOException{ int d. c=d*d*d.. wap : armstrong import java.......out.. System...out.println("no. s=s+c........f2=f3.