Check palindrome number in javaimport java.util.Scanner; class CheckNumberPalindromeOrNotPalindromeClass{ public static void main(String[] args){ //rev variable is used to store reverse of actual_num //actual_num contains number accepted from user //temp_num variable is used for temporary ...
Java Program to Check if a given Number is Perfect Number - When the sum of factors of a given number (after discarding the given number) is equal to the number itself is called a perfect number. The sum of these divisors is known as the aliquot sum. Thu
In this tutorial, we will see a Java program to check if the given String is palindrome or not.Java Program To Check If the given String Is Palindrome or Not...
Java Program import java.util.Scanner; public class StrongNumber { // Function to calculate the factorial of a number public static int factorial(int num) { int fact = 1; for (int i = 1; i <= num; i++) { fact *= i; } return fact; } // Function to check if the number is...
Program to find occurrences of palindrome words in string in java importjava.io.*;importjava.util.*;classCheckPalindromeWords{// create object of buffer class.staticBufferedReaderbr=newBufferedReader(newInputStreamReader(System.in));// function to check palindromebooleanIsPalindrome(Strings){intl=s....
In the following Java program, we will use if-else block to check if the given integer variable is a positive number or negative.Open Compiler public class Example1 { public static void main(String[] args) { int myInput = 788; System.out.println("The given number is: " + myInput);...
/* Program 1: C program to check whether given integer is palindrome number */ /* palindrome_string_ver.c */ #include <stdio.h> #include <string.h> #define NUM_LENGTH 20 //String version int isPalindrome(int n) { int palindrome = 1, length = 0, i = 0; char number[NUM_LENGTH...
Number 4 100 Bitwise XOR 1 001 Java Program to Swap Two Number Using Bitwise XOR operator Java class Swap { public static void main(String[] args) { int a = 11, b = 22; System.out.println("Before swapping the numbers:"); System.out.println("First number = " + a); System.out...
4. If the sum is equal to the number, print “The number is a perfect number”. 5. If the sum is not equal to the number, print “The number is not a perfect number”. Program/Source Code Here is the source code of the Java Program to Check if a given Number is Perfect Number...
Java Program to Check Prime Number Java Program to Check Whether a Number is a Palindrome or Not Java Program to Find the Factorial of a Number Java Program to Reverse a Number Java Program to search an element in a Linked List Program to convert ArrayList to LinkedList in Java ...