Looking for a Tutor Near You?

Post Learning Requirement »
x

Choose Country Code

x

Direction

x

Ask a Question

x

x
x
x
Hire a Tutor

ICSE Computer Notes

Loading...

Published in: Java And J2EE
1,500 Views

Java programs

Jayeeta B / Kolkata

3 years of teaching experience

Qualification: MCA

Teaches: All Subjects, Computer, Computer Science, School Level Computer

Contact this Tutor
  1. Write a menu driven program in JAVA to check either a number or a word palindromecy according to user's choice. import java.io.* class prg9 { public static void main(String args[])throws IOException {BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); System.out.println("Enter choice"); System.out.println("1.To check a number for palindromecy"); System.out.println("2.To check a word for palindromecy"); int ch=lnteger.parselnt(br.readLine()); switch(ch) {case 1:System.out.println("Enter a number"); int n=lnteger.parselnt(br.readLine()); int n1=n,s=O; while(n>O) {int a=n%10; n=n/10; s=(s*10)+a;} if(s==nl) System.out.println("lt is a pallindrome number"); else System.out.println("lt is not a pallindrome number"); break; case 2:System.out.println("Enter a word"); String x=br.readLine(); int l=x.length(); String w= for(int i=O;i
  2. else { System.out.println("lt is not Palindrome word");} break; default: System.out.println("Error!"); break; OUTPUT Enter choice 1. To check a number for palindromecy 2. To check a word for palindromecy 1 Enter a number 212 It is a pallindrome number