Write a program to check if a string or integer is palindrome or not? write the output For a Given multiple inheritance program? write the output for a given method overriding program?
Programs to check palindrome and output for multiple inheritance and method overriding
Palindrome program can be implemented using string or integer reversal and comparison
Output for multiple inheritan...read more
public class Palindrome {
public static boolean isPalindrome(String str) {
for (int i = 0; i < str.length() / 2; i++) {
int n = str.length();
if (str.charAt(i) != str.charAt(n - 1 - i)) {
// not a palondro...read more
class Main{
public static void main(String[] args) {
Scanner scan=new Scanner(System.in);
String s=scan.nextLine();
boolean b=true;
for(int i=0,j=s.length()-1;i<=j;i++,j--)
{
if(s.charAt(i)==s.charAt(j))
continue;
else
{
b=false;
break;
}
}
if(b)
System.out.print("Its Palindrome");
else
System.out.print("Not a Palindrome");
}
}
public class Palindrome {
public static boolean isPalindrome(String str) {
for (int i = 0; i < str.length() / 2; i++) {
int n = str.length();
if (str.charAt(i) != str.charAt(n - 1 - i)) {
// not a pal...read more
//Program for palindrome
import java.util.Scanner;
class Palindrome
{
public static void main(Strong[] args)
{
Scanner input: new Scanner(System.in);
int num,Rev=0,Rem,I=0;
num = nextInt();
temp=num;
while(temp!=0)
{
rem=temp%10;
rev=rev*10+rem;
temp=temp/10;
}
if(rev==num)
{
System.out.println(rev+" is palindrome);
}
else
{
System.out.println(rev+" is not palindrome");
}
}
}
Class palindrome{
public static void main(String [ ] args) {
int n=121;
int temp=n;
int rem=0;
int sum=0;
while(n>0)
{
rem=n%10;
sum=sum*10+rem;
n=n/10;
}
if(temp==sum){
"It is a palindrome";
}
else{
"It is not a pal...read more
def is_palindrome(value):
# Convert the value to a string for consistent comparison
value = str(value)
# Check if the reversed value is equal to the original value
if value == value[::-1]:
return Tru...read more
Top EPAM Systems Senior QA Automation Engineer interview questions & answers
Top HR questions asked in EPAM Systems Senior QA Automation Engineer
Reviews
Interviews
Salaries
Users/Month