Hacking with an algorithm to find prime factor of a number

$./app Sign detection [1] Power of two [2] Counting No. of bits set [3] Set or clear bits without branching[4] Find maximum value[5] Finding least common multiple[6] Finding the greatest commom divisor[7] Finding if a number is an Armstrong number or not[8] Finding if a given number is prime number[9] Finding the number of twin …

How to write an algorithm to find if a number is palindrome or not

#include <stdio.h> palindrome() { int n, reverse = 0, temp; printf(“Enter a number to check if it is a palindrome or not: “); scanf(“%d”,&n); temp = n; while ( temp != 0 ) { reverse = reverse * 10; reverse = reverse + temp % 10; temp = temp/10; } if ( n == reverse …