Using the programming language Java or C++,
Write a function that takes an integer as input. Return true if
this integer is a palindrome integer; false otherwise;
import java.util.Scanner;
class PalindromeExample{
public static void main(String args[]){
Scanner in = new Scanner(System.in);
System.out.println("Enter a number to check if it is a palindrome");
int n=in.nextInt();
int result=checkpal(n);
if(result ==1)
System.out.println("palindrome number ");
else
System.out.println("not palindrome");
}
public static int checkpal( int n)
{
int r,sum=0,temp;
//It is the number variable to be checked for palindrome
temp=n;
while(n>0)
{
r=n%10; //getting remainder
sum=(sum*10)+r;
n=n/10;
}
if(temp==sum)
return 1;
else
return 0;
}
}
Using the programming language Java or C++, Write a function that takes an integer as input....
Using C++ Question#1: isPalíndrome Write the following function: bool isPalindrome(int) takes an integer and returns true if that integer is palindrome, otherwise it returns false. The function also prints the digits of the integer in reverse order in which they were found. Write a main) function that reads an integer, calls the function is whether the integer is a palindrome or not. Palindrome), and prints Sample input/output: nter an integer: 23434 nter an integer 23432 3434 is not a palindrome...
Question is two parts In R(Programming language). Define and write a function which takes one number as input and detects whether the number is even. Return TRUE if it is even, and FALSE otherwise. You need to first detect if the input is an integer; if not, return NA. Note 1: TRUE and FALSE are logical values, not strings! Note 2: No need to get user input from the console. Test your function using your_function_name(1), your_function_name(2), and your_function_name(1.5). Hint: What...
C++ programming language Write a program that contains following function: A function that receives a string of character, the function return true if the string contains letter c or C, otherwise, return false.
C++ Programming: Write a function that takes in a C++-style string s (from #include ), as well as an integer n, and then returns true if any substring of length n in s repeats itself, and false otherwise. For example, if s is "toe-to-toe" and n is 3, then the function would return true since "toe" occurs twice within s. However, if n were 4, the function would return false. As a second example, if s is "singing" and n...
Using the C programming language, write a program that takes in hexadecimal characters (using the fgets() function) and return a translated string of ASCII characters. Use only BITWISE operators, not arithmetic.
Haskell Functional Programming Language: Write a function nestedParens that takes a string argument and returns true if it is a nesting of zero or more pairs of parentheses, e.g. "((()))" should return True ; "()()" or "(()))" should return False . Use recursion for this problem. nestedParens :: String -> Bool
Please use python 3 programming language Write a function that gets a string representing a file name and a list. The function writes the content of the list to the file. Each item in the list is written on one line. Name the function WriteList. If all goes well the function returns true, otherwise it returns false. Write another function, RandomRange that takes an integer then it returns a list of length n, where n is an integer passed as...
In C++, write a function isOdd() that takes one integer parameter. The function returns true if the number if odd and false otherwise.
Using the programming language C, read user input of an integer, check and output whether the integer is an odd number or even number.
C language please Write the definition of a function isSenior, which receives an integer parameter and returns true if the parameter's value is greater or equal to 65, and false otherwise. So if the parameter's value is 7 or 64 or 12 the function returns false. But if the parameter's value is 69 or 83 or 65 the function returns true.